Don't preload rarely seen large images
[chromium-blink-merge.git] / components / user_manager / user_image / default_user_images.h
blob34bc8bc1c9e9d78ab66ca317a7a05af294817e11
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.
5 #ifndef COMPONENTS_USER_MANAGER_USER_IMAGE_DEFAULT_USER_IMAGES_H_
6 #define COMPONENTS_USER_MANAGER_USER_IMAGE_DEFAULT_USER_IMAGES_H_
8 #include <cstddef> // for size_t
9 #include <string>
11 #include "base/strings/string16.h"
12 #include "components/user_manager/user_manager_export.h"
14 namespace gfx {
15 class ImageSkia;
18 namespace user_manager {
20 // Returns URL to default user image with specified index.
21 USER_MANAGER_EXPORT std::string GetDefaultImageUrl(int index);
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);
28 // Returns bitmap of default user image with specified index.
29 USER_MANAGER_EXPORT const gfx::ImageSkia& GetDefaultImage(int index);
31 // Returns a description of a default user image with specified index.
32 USER_MANAGER_EXPORT base::string16 GetDefaultImageDescription(int index);
34 // Resource IDs of default user images.
35 USER_MANAGER_EXPORT extern const int kDefaultImageResourceIDs[];
37 // String IDs of author names for default user images.
38 USER_MANAGER_EXPORT extern const int kDefaultImageAuthorIDs[];
40 // String IDs of websites for default user images.
41 USER_MANAGER_EXPORT extern const int kDefaultImageWebsiteIDs[];
43 // Number of default images.
44 USER_MANAGER_EXPORT extern const int kDefaultImagesCount;
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;
50 /// Histogram values. ////////////////////////////////////////////////////////
52 // Histogram value for user image taken from file.
53 USER_MANAGER_EXPORT extern const int kHistogramImageFromFile;
55 // Histogram value for user image taken from camera.
56 USER_MANAGER_EXPORT extern const int kHistogramImageFromCamera;
58 // Histogram value a previously used image from camera/file.
59 USER_MANAGER_EXPORT extern const int kHistogramImageOld;
61 // Histogram value for user image from G+ profile.
62 USER_MANAGER_EXPORT extern const int kHistogramImageFromProfile;
64 // Histogram value for user video (animated avatar) from camera.
65 USER_MANAGER_EXPORT extern const int kHistogramVideoFromCamera;
67 // Histogram value for user video from file.
68 USER_MANAGER_EXPORT extern const int kHistogramVideoFromFile;
70 // Number of possible histogram values for user images.
71 USER_MANAGER_EXPORT extern const int kHistogramImagesCount;
73 // Returns the histogram value corresponding to the given default image index.
74 USER_MANAGER_EXPORT int GetDefaultImageHistogramValue(int index);
76 } // namespace user_manager
78 #endif // COMPONENTS_USER_MANAGER_USER_IMAGE_DEFAULT_USER_IMAGES_H_