OLD | NEW |
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_THEME_SOURCE_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_THEME_SOURCE_H_ |
6 #define CHROME_BROWSER_UI_WEBUI_THEME_SOURCE_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_THEME_SOURCE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 explicit ThemeSource(Profile* profile); | 23 explicit ThemeSource(Profile* profile); |
24 virtual ~ThemeSource(); | 24 virtual ~ThemeSource(); |
25 | 25 |
26 // content::URLDataSource implementation. | 26 // content::URLDataSource implementation. |
27 virtual std::string GetSource() OVERRIDE; | 27 virtual std::string GetSource() OVERRIDE; |
28 virtual void StartDataRequest( | 28 virtual void StartDataRequest( |
29 const std::string& path, | 29 const std::string& path, |
30 bool is_incognito, | 30 bool is_incognito, |
31 const content::URLDataSource::GotDataCallback& callback) OVERRIDE; | 31 const content::URLDataSource::GotDataCallback& callback) OVERRIDE; |
32 virtual std::string GetMimeType(const std::string& path) const OVERRIDE; | 32 virtual std::string GetMimeType(const std::string& path) const OVERRIDE; |
33 virtual MessageLoop* MessageLoopForRequestPath( | 33 virtual base::MessageLoop* MessageLoopForRequestPath( |
34 const std::string& path) const OVERRIDE; | 34 const std::string& path) const OVERRIDE; |
35 virtual bool ShouldReplaceExistingSource() const OVERRIDE; | 35 virtual bool ShouldReplaceExistingSource() const OVERRIDE; |
36 virtual bool ShouldServiceRequest( | 36 virtual bool ShouldServiceRequest( |
37 const net::URLRequest* request) const OVERRIDE; | 37 const net::URLRequest* request) const OVERRIDE; |
38 | 38 |
39 private: | 39 private: |
40 // Fetch and send the theme bitmap. | 40 // Fetch and send the theme bitmap. |
41 void SendThemeBitmap( | 41 void SendThemeBitmap( |
42 const content::URLDataSource::GotDataCallback& callback, | 42 const content::URLDataSource::GotDataCallback& callback, |
43 int resource_id, | 43 int resource_id, |
44 ui::ScaleFactor scale_factor); | 44 ui::ScaleFactor scale_factor); |
45 | 45 |
46 // The original profile (never an OTR profile). | 46 // The original profile (never an OTR profile). |
47 Profile* profile_; | 47 Profile* profile_; |
48 | 48 |
49 // We grab the CSS early so we don't have to go back to the UI thread later. | 49 // We grab the CSS early so we don't have to go back to the UI thread later. |
50 scoped_refptr<base::RefCountedMemory> css_bytes_; | 50 scoped_refptr<base::RefCountedMemory> css_bytes_; |
51 | 51 |
52 DISALLOW_COPY_AND_ASSIGN(ThemeSource); | 52 DISALLOW_COPY_AND_ASSIGN(ThemeSource); |
53 }; | 53 }; |
54 | 54 |
55 #endif // CHROME_BROWSER_UI_WEBUI_THEME_SOURCE_H_ | 55 #endif // CHROME_BROWSER_UI_WEBUI_THEME_SOURCE_H_ |
OLD | NEW |