- add sources.
[platform/framework/web/crosswalk.git] / src / chrome / browser / chromeos / login / default_user_images.h
1 // Copyright (c) 2012 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 CHROME_BROWSER_CHROMEOS_LOGIN_DEFAULT_USER_IMAGES_H_
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_DEFAULT_USER_IMAGES_H_
7
8 #include <cstddef>  // for size_t
9 #include <string>
10
11 #include "base/strings/string16.h"
12
13 namespace gfx {
14 class ImageSkia;
15 }
16
17 namespace chromeos {
18
19 // Returns path to default user image with specified index.
20 // The path is used in Local State to distinguish default images.
21 // This function is obsolete and is preserved only for compatibility with older
22 // profiles which don't user separate image index and path.
23 std::string GetDefaultImagePath(int index);
24
25 // Checks if given path is one of the default ones. If it is, returns true
26 // and its index through |image_id|. If not, returns false.
27 bool IsDefaultImagePath(const std::string& path, int* image_id);
28
29 // Returns URL to default user image with specified index.
30 std::string GetDefaultImageUrl(int index);
31
32 // Checks if the given URL points to one of the default images. If it is,
33 // returns true and its index through |image_id|. If not, returns false.
34 bool IsDefaultImageUrl(const std::string& url, int* image_id);
35
36 // Returns bitmap of default user image with specified index.
37 const gfx::ImageSkia& GetDefaultImage(int index);
38
39 // Returns a description of a default user image with specified index.
40 string16 GetDefaultImageDescription(int index);
41
42 // Resource IDs of default user images.
43 extern const int kDefaultImageResourceIDs[];
44
45 // String IDs of author names for default user images.
46 extern const int kDefaultImageAuthorIDs[];
47
48 // String IDs of websites for default user images.
49 extern const int kDefaultImageWebsiteIDs[];
50
51 // Number of default images.
52 extern const int kDefaultImagesCount;
53
54 // The starting index of default images available for selection. Note that
55 // existing users may have images with smaller indices.
56 extern const int kFirstDefaultImageIndex;
57
58 /// Histogram values. ////////////////////////////////////////////////////////
59
60 // Histogram value for user image taken from file.
61 extern const int kHistogramImageFromFile;
62
63 // Histogram value for user image taken from camera.
64 extern const int kHistogramImageFromCamera;
65
66 // Histogram value a previously used image from camera/file.
67 extern const int kHistogramImageOld;
68
69 // Histogram value for user image from G+ profile.
70 extern const int kHistogramImageFromProfile;
71
72 // Histogram value for user video (animated avatar) from camera.
73 extern const int kHistogramVideoFromCamera;
74
75 // Histogram value for user video from file.
76 extern const int kHistogramVideoFromFile;
77
78 // Number of possible histogram values for user images.
79 extern const int kHistogramImagesCount;
80
81 // Returns the histogram value corresponding to the given default image index.
82 int GetDefaultImageHistogramValue(int index);
83
84 }  // namespace chromeos
85
86 #endif  // CHROME_BROWSER_CHROMEOS_LOGIN_DEFAULT_USER_IMAGES_H_