OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_DOM_UI_DOM_UI_THEME_SOURCE_H_ | 5 #ifndef CHROME_BROWSER_DOM_UI_DOM_UI_THEME_SOURCE_H_ |
6 #define CHROME_BROWSER_DOM_UI_DOM_UI_THEME_SOURCE_H_ | 6 #define CHROME_BROWSER_DOM_UI_DOM_UI_THEME_SOURCE_H_ |
7 | 7 |
| 8 #include <string> |
| 9 |
8 #include "chrome/browser/dom_ui/chrome_url_data_manager.h" | 10 #include "chrome/browser/dom_ui/chrome_url_data_manager.h" |
9 | 11 |
10 class Profile; | 12 class Profile; |
11 | 13 |
12 // ThumbnailSource is the gateway between network-level chrome: | 14 // ThumbnailSource is the gateway between network-level chrome: |
13 // requests for thumbnails and the history backend that serves these. | 15 // requests for thumbnails and the history backend that serves these. |
14 class DOMUIThemeSource : public ChromeURLDataManager::DataSource { | 16 class DOMUIThemeSource : public ChromeURLDataManager::DataSource { |
15 public: | 17 public: |
16 explicit DOMUIThemeSource(Profile* profile); | 18 explicit DOMUIThemeSource(Profile* profile); |
17 | 19 |
18 // Called when the network layer has requested a resource underneath | 20 // Called when the network layer has requested a resource underneath |
19 // the path we registered. | 21 // the path we registered. |
20 virtual void StartDataRequest(const std::string& path, int request_id); | 22 virtual void StartDataRequest(const std::string& path, int request_id); |
21 virtual std::string GetMimeType(const std::string& path) const; | 23 virtual std::string GetMimeType(const std::string& path) const; |
22 | 24 |
23 virtual void SendResponse(int request_id, RefCountedBytes* data); | 25 virtual void SendResponse(int request_id, RefCountedBytes* data); |
24 | 26 |
25 private: | 27 private: |
26 // Generate and send the CSS for the new tab. | 28 // Generate and send the CSS for the new tab. |
27 void SendNewTabCSS(int request_id); | 29 void SendNewTabCSS(int request_id); |
28 | 30 |
29 // Fetch and send the theme bitmap. | 31 // Fetch and send the theme bitmap. |
30 void SendThemeBitmap(int request_id, int resource_id); | 32 void SendThemeBitmap(int request_id, int resource_id); |
31 | 33 |
| 34 // Get the CSS string for the background position on the new tab page for the |
| 35 // states when the bar is attached or detached. |
| 36 std::string GetNewTabBackgroundCSS(bool bar_attached); |
| 37 |
32 Profile* profile_; | 38 Profile* profile_; |
33 DISALLOW_COPY_AND_ASSIGN(DOMUIThemeSource); | 39 DISALLOW_COPY_AND_ASSIGN(DOMUIThemeSource); |
34 }; | 40 }; |
35 | 41 |
36 #endif // CHROME_BROWSER_DOM_UI_DOM_UI_THEME_SOURCE_H_ | 42 #endif // CHROME_BROWSER_DOM_UI_DOM_UI_THEME_SOURCE_H_ |
OLD | NEW |