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

Side by Side Diff: chrome/browser/ui/webui/options/chromeos/user_image_source.h

Issue 11881055: Simplify WebUI data sources. Currently WebUI data sources implement a URLDataSourceDelegate interfa… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix issue in about_ui exposed by cros tests Created 7 years, 11 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_UI_WEBUI_OPTIONS_CHROMEOS_USER_IMAGE_SOURCE_H_ 5 #ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS_CHROMEOS_USER_IMAGE_SOURCE_H_
6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS_CHROMEOS_USER_IMAGE_SOURCE_H_ 6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS_CHROMEOS_USER_IMAGE_SOURCE_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/basictypes.h" 11 #include "base/basictypes.h"
12 #include "base/compiler_specific.h" 12 #include "base/compiler_specific.h"
13 #include "content/public/browser/url_data_source_delegate.h" 13 #include "content/public/browser/url_data_source.h"
14 #include "ui/base/layout.h" 14 #include "ui/base/layout.h"
15 15
16 namespace base { 16 namespace base {
17 class RefCountedMemory; 17 class RefCountedMemory;
18 } 18 }
19 19
20 namespace chromeos { 20 namespace chromeos {
21 namespace options { 21 namespace options {
22 22
23 // UserImageSource is the data source that serves user images for users that 23 // UserImageSource is the data source that serves user images for users that
24 // have it. 24 // have it.
25 class UserImageSource : public content::URLDataSourceDelegate { 25 class UserImageSource : public content::URLDataSource {
26 public: 26 public:
27 UserImageSource(); 27 UserImageSource();
28 28
29 // content::URLDataSourceDelegate implementation. 29 // content::URLDataSource implementation.
30 virtual std::string GetSource() OVERRIDE; 30 virtual std::string GetSource() OVERRIDE;
31 virtual void StartDataRequest(const std::string& path, 31 virtual void StartDataRequest(
32 bool is_incognito, 32 const std::string& path,
33 int request_id) OVERRIDE; 33 bool is_incognito,
34 const content::URLDataSource::GotDataCallback& callback) OVERRIDE;
34 virtual std::string GetMimeType(const std::string& path) const OVERRIDE; 35 virtual std::string GetMimeType(const std::string& path) const OVERRIDE;
35 36
36 // Returns PNG or GIF (when possible and if |is_image_animated| flag 37 // Returns PNG or GIF (when possible and if |is_image_animated| flag
37 // is true) encoded image for user with specified email. If there's 38 // is true) encoded image for user with specified email. If there's
38 // no user with such email, returns the first default image. 39 // no user with such email, returns the first default image.
39 base::RefCountedMemory* GetUserImage(const std::string& email, 40 base::RefCountedMemory* GetUserImage(const std::string& email,
40 bool is_image_animated, 41 bool is_image_animated,
41 ui::ScaleFactor scale_factor) const; 42 ui::ScaleFactor scale_factor) const;
42 43
43 private: 44 private:
44 virtual ~UserImageSource(); 45 virtual ~UserImageSource();
45 46
46 DISALLOW_COPY_AND_ASSIGN(UserImageSource); 47 DISALLOW_COPY_AND_ASSIGN(UserImageSource);
47 }; 48 };
48 49
49 } // namespace options 50 } // namespace options
50 } // namespace chromeos 51 } // namespace chromeos
51 52
52 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_CHROMEOS_USER_IMAGE_SOURCE_H_ 53 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_CHROMEOS_USER_IMAGE_SOURCE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698