• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef COMPONENTS_USER_MANAGER_USER_IMAGE_DEFAULT_USER_IMAGES_H_
6 #define COMPONENTS_USER_MANAGER_USER_IMAGE_DEFAULT_USER_IMAGES_H_
7 
8 #include <cstddef>  // for size_t
9 #include <string>
10 
11 #include "base/strings/string16.h"
12 #include "components/user_manager/user_manager_export.h"
13 
14 namespace gfx {
15 class ImageSkia;
16 }
17 
18 namespace user_manager {
19 
20 // Returns URL to default user image with specified index.
21 USER_MANAGER_EXPORT std::string GetDefaultImageUrl(int index);
22 
23 // Checks if the given URL points to one of the default images. If it is,
24 // returns true and its index through |image_id|. If not, returns false.
25 USER_MANAGER_EXPORT bool IsDefaultImageUrl(const std::string& url,
26                                            int* image_id);
27 
28 // Returns bitmap of default user image with specified index.
29 USER_MANAGER_EXPORT const gfx::ImageSkia& GetDefaultImage(int index);
30 
31 // Returns a description of a default user image with specified index.
32 USER_MANAGER_EXPORT base::string16 GetDefaultImageDescription(int index);
33 
34 // Resource IDs of default user images.
35 USER_MANAGER_EXPORT extern const int kDefaultImageResourceIDs[];
36 
37 // String IDs of author names for default user images.
38 USER_MANAGER_EXPORT extern const int kDefaultImageAuthorIDs[];
39 
40 // String IDs of websites for default user images.
41 USER_MANAGER_EXPORT extern const int kDefaultImageWebsiteIDs[];
42 
43 // Number of default images.
44 USER_MANAGER_EXPORT extern const int kDefaultImagesCount;
45 
46 // The starting index of default images available for selection. Note that
47 // existing users may have images with smaller indices.
48 USER_MANAGER_EXPORT extern const int kFirstDefaultImageIndex;
49 
50 /// Histogram values. ////////////////////////////////////////////////////////
51 
52 // Histogram value for user image taken from file.
53 USER_MANAGER_EXPORT extern const int kHistogramImageFromFile;
54 
55 // Histogram value for user image taken from camera.
56 USER_MANAGER_EXPORT extern const int kHistogramImageFromCamera;
57 
58 // Histogram value a previously used image from camera/file.
59 USER_MANAGER_EXPORT extern const int kHistogramImageOld;
60 
61 // Histogram value for user image from G+ profile.
62 USER_MANAGER_EXPORT extern const int kHistogramImageFromProfile;
63 
64 // Histogram value for user video (animated avatar) from camera.
65 USER_MANAGER_EXPORT extern const int kHistogramVideoFromCamera;
66 
67 // Histogram value for user video from file.
68 USER_MANAGER_EXPORT extern const int kHistogramVideoFromFile;
69 
70 // Number of possible histogram values for user images.
71 USER_MANAGER_EXPORT extern const int kHistogramImagesCount;
72 
73 // Returns the histogram value corresponding to the given default image index.
74 USER_MANAGER_EXPORT int GetDefaultImageHistogramValue(int index);
75 
76 }  // namespace user_manager
77 
78 #endif  // COMPONENTS_USER_MANAGER_USER_IMAGE_DEFAULT_USER_IMAGES_H_
79