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

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

Issue 10667034: [cros] Cache the URL of user's G+ profile photo to prevent redundant downloads. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 months 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 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 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_USER_IMAGE_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_USER_IMAGE_H_
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_USER_IMAGE_H_ 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_USER_IMAGE_H_
7 #pragma once 7 #pragma once
8 8
9 #include <vector> 9 #include <vector>
10 10
11 #include "googleurl/src/gurl.h"
11 #include "ui/gfx/image/image_skia.h" 12 #include "ui/gfx/image/image_skia.h"
12 13
13 namespace chromeos { 14 namespace chromeos {
14 15
15 // Wrapper class for bitmaps and raw images when it's necessary. Could 16 // Wrapper class for bitmaps and raw images when it's necessary. Could
16 // be used for storing profile images (including animated profile 17 // be used for storing profile images (including animated profile
17 // images) and user wallpapers. 18 // images) and user wallpapers.
18 class UserImage { 19 class UserImage {
19 public: 20 public:
20 typedef std::vector<unsigned char> RawImage; 21 typedef std::vector<unsigned char> RawImage;
(...skipping 17 matching lines...) Expand all
38 39
39 // Returns true iff |image| argument of constructors or |SetImage| 40 // Returns true iff |image| argument of constructors or |SetImage|
40 // can be encoded as a bitmap. 41 // can be encoded as a bitmap.
41 bool has_raw_image() const { return has_raw_image_; } 42 bool has_raw_image() const { return has_raw_image_; }
42 const RawImage& raw_image() const { return raw_image_; } 43 const RawImage& raw_image() const { return raw_image_; }
43 44
44 // Returns true iff UserImage is constructed from animated image. 45 // Returns true iff UserImage is constructed from animated image.
45 bool has_animated_image() const { return has_animated_image_; } 46 bool has_animated_image() const { return has_animated_image_; }
46 const RawImage& animated_image() const { return animated_image_; } 47 const RawImage& animated_image() const { return animated_image_; }
47 48
49 // URL from which this image was originally downloaded, if any.
50 void set_url(const GURL& url) { url_ = url; }
51 GURL url() const { return url_; }
52
48 private: 53 private:
49 gfx::ImageSkia image_; 54 gfx::ImageSkia image_;
50 bool has_raw_image_; 55 bool has_raw_image_;
51 RawImage raw_image_; 56 RawImage raw_image_;
52 bool has_animated_image_; 57 bool has_animated_image_;
53 RawImage animated_image_; 58 RawImage animated_image_;
59 GURL url_;
54 }; 60 };
55 61
56 } // namespace chromeos 62 } // namespace chromeos
57 63
58 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USER_IMAGE_H_ 64 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USER_IMAGE_H_
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/user.cc ('k') | chrome/browser/chromeos/login/user_manager_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698