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_BOOKMARKS_UI_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_BOOKMARKS_UI_H_ |
6 #define CHROME_BROWSER_UI_WEBUI_BOOKMARKS_UI_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_BOOKMARKS_UI_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" | 10 #include "base/compiler_specific.h" |
| 11 #include "content/public/browser/url_data_source_delegate.h" |
11 #include "content/public/browser/web_ui_controller.h" | 12 #include "content/public/browser/web_ui_controller.h" |
12 #include "ui/base/layout.h" | 13 #include "ui/base/layout.h" |
13 | 14 |
14 namespace base { | 15 namespace base { |
15 class RefCountedMemory; | 16 class RefCountedMemory; |
16 } | 17 } |
17 | 18 |
18 // This class provides the source for chrome://bookmarks/ | 19 // This class provides the source for chrome://bookmarks/ |
19 class BookmarksUIHTMLSource : public ChromeURLDataManager::DataSource { | 20 class BookmarksUIHTMLSource : public content::URLDataSourceDelegate { |
20 public: | 21 public: |
21 BookmarksUIHTMLSource(); | 22 BookmarksUIHTMLSource(); |
22 | 23 |
23 // Called when the network layer has requested a resource underneath | 24 // content::URLDataSourceDelegate implementation. |
24 // the path we registered. | 25 virtual std::string GetSource() OVERRIDE; |
25 virtual void StartDataRequest(const std::string& path, | 26 virtual void StartDataRequest(const std::string& path, |
26 bool is_incognito, | 27 bool is_incognito, |
27 int request_id) OVERRIDE; | 28 int request_id) OVERRIDE; |
28 virtual std::string GetMimeType(const std::string& path) const OVERRIDE; | 29 virtual std::string GetMimeType(const std::string& path) const OVERRIDE; |
29 | 30 |
30 private: | 31 private: |
31 virtual ~BookmarksUIHTMLSource(); | 32 virtual ~BookmarksUIHTMLSource(); |
32 | 33 |
33 DISALLOW_COPY_AND_ASSIGN(BookmarksUIHTMLSource); | 34 DISALLOW_COPY_AND_ASSIGN(BookmarksUIHTMLSource); |
34 }; | 35 }; |
35 | 36 |
36 // This class is used to hook up chrome://bookmarks/ which in turn gets | 37 // This class is used to hook up chrome://bookmarks/ which in turn gets |
37 // overridden by an extension. | 38 // overridden by an extension. |
38 class BookmarksUI : public content::WebUIController { | 39 class BookmarksUI : public content::WebUIController { |
39 public: | 40 public: |
40 explicit BookmarksUI(content::WebUI* web_ui); | 41 explicit BookmarksUI(content::WebUI* web_ui); |
41 | 42 |
42 static base::RefCountedMemory* GetFaviconResourceBytes( | 43 static base::RefCountedMemory* GetFaviconResourceBytes( |
43 ui::ScaleFactor scale_factor); | 44 ui::ScaleFactor scale_factor); |
44 | 45 |
45 private: | 46 private: |
46 DISALLOW_COPY_AND_ASSIGN(BookmarksUI); | 47 DISALLOW_COPY_AND_ASSIGN(BookmarksUI); |
47 }; | 48 }; |
48 | 49 |
49 #endif // CHROME_BROWSER_UI_WEBUI_BOOKMARKS_UI_H_ | 50 #endif // CHROME_BROWSER_UI_WEBUI_BOOKMARKS_UI_H_ |
OLD | NEW |