Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(120)

Side by Side Diff: chrome/browser/chromeos/login/default_user_images.h

Issue 8541002: [cros] Initial user image loading and repeated profile image loading fixes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Whitespace Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/chromeos/login/default_user_images.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #pragma once 5 #pragma once
6 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_DEFAULT_USER_IMAGES_H_ 6 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_DEFAULT_USER_IMAGES_H_
7 #define CHROME_BROWSER_CHROMEOS_LOGIN_DEFAULT_USER_IMAGES_H_ 7 #define CHROME_BROWSER_CHROMEOS_LOGIN_DEFAULT_USER_IMAGES_H_
8 8
9 #include <cstddef> // for size_t 9 #include <cstddef> // for size_t
10 #include <string> 10 #include <string>
11 11
12 class SkBitmap;
13
12 namespace chromeos { 14 namespace chromeos {
13 15
14 // Returns path to default user image with specified index. 16 // Returns path to default user image with specified index.
15 // The path is used in Local State to distinguish default images. 17 // The path is used in Local State to distinguish default images.
18 // This function is obsolete and is preserved only for compatibility with older
19 // profiles which don't user separate image index and path.
16 std::string GetDefaultImagePath(int index); 20 std::string GetDefaultImagePath(int index);
17 21
18 // Checks if given path is one of the default ones. If it is, returns true 22 // Checks if given path is one of the default ones. If it is, returns true
19 // and its index through |image_id|. If not, returns false. 23 // and its index through |image_id|. If not, returns false.
20 bool IsDefaultImagePath(const std::string& path, int* image_id); 24 bool IsDefaultImagePath(const std::string& path, int* image_id);
21 25
22 // Returns URL to default user image with specifided index. 26 // Returns URL to default user image with specified index.
23 std::string GetDefaultImageUrl(int index); 27 std::string GetDefaultImageUrl(int index);
24 28
25 // Checks if the given URL points to one of the default images. If it is, 29 // Checks if the given URL points to one of the default images. If it is,
26 // returns true and its index through |image_id|. If not, returns false. 30 // returns true and its index through |image_id|. If not, returns false.
27 bool IsDefaultImageUrl(const std::string url, int* image_id); 31 bool IsDefaultImageUrl(const std::string url, int* image_id);
28 32
33 // Returns bitmap of default user image with specified index.
34 const SkBitmap& GetDefaultImage(int index);
35
29 // Resource IDs of default user images. 36 // Resource IDs of default user images.
30 extern const int kDefaultImageResources[]; 37 extern const int kDefaultImageResources[];
31 38
32 // Number of default images. 39 // Number of default images.
33 extern const int kDefaultImagesCount; 40 extern const int kDefaultImagesCount;
34 41
35 // Image index to be used in histograms when user image is taken from file. 42 // Image index to be used in histograms when user image is taken from file.
36 extern const int kHistogramImageFromFile; 43 extern const int kHistogramImageFromFile;
37 44
38 // Image index to be used in histograms when user image is taken from camera. 45 // Image index to be used in histograms when user image is taken from camera.
39 extern const int kHistogramImageFromCamera; 46 extern const int kHistogramImageFromCamera;
40 47
41 // Image index to be used in histograms when user selects a previously used 48 // Image index to be used in histograms when user selects a previously used
42 // image from camera/file. 49 // image from camera/file.
43 extern const int kHistogramImageOld; 50 extern const int kHistogramImageOld;
44 51
45 // Image index to be used in histograms when user image is taken from profile. 52 // Image index to be used in histograms when user image is taken from profile.
46 extern const int kHistogramImageFromProfile; 53 extern const int kHistogramImageFromProfile;
47 54
48 // Number of possible user image indices to be used in histograms. 55 // Number of possible user image indices to be used in histograms.
49 extern const int kHistogramImagesCount; 56 extern const int kHistogramImagesCount;
50 57
51 } // namespace chromeos 58 } // namespace chromeos
52 59
53 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_DEFAULT_USER_IMAGES_H_ 60 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_DEFAULT_USER_IMAGES_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/login/default_user_images.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698