OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_APP_LAUNCHER_PAGE_UI_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_APP_LAUNCHER_PAGE_UI_H_ |
6 #define CHROME_BROWSER_UI_WEBUI_APP_LAUNCHER_PAGE_UI_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_APP_LAUNCHER_PAGE_UI_H_ |
7 | 7 |
8 #include "content/public/browser/url_data_source.h" | 8 #include "content/public/browser/url_data_source.h" |
9 #include "content/public/browser/web_ui_controller.h" | 9 #include "content/public/browser/web_ui_controller.h" |
10 #include "ui/base/layout.h" | 10 #include "ui/base/layout.h" |
11 | 11 |
12 class Profile; | 12 class Profile; |
13 | 13 |
14 namespace base { | 14 namespace base { |
15 class RefCountedMemory; | 15 class RefCountedMemory; |
16 } | 16 } |
17 | 17 |
18 // The WebUIController used for the app launcher page UI. | 18 // The WebUIController used for the app launcher page UI. |
19 class AppLauncherPageUI : public content::WebUIController { | 19 class AppLauncherPageUI : public content::WebUIController { |
20 public: | 20 public: |
21 explicit AppLauncherPageUI(content::WebUI* web_ui); | 21 explicit AppLauncherPageUI(content::WebUI* web_ui); |
22 virtual ~AppLauncherPageUI(); | 22 ~AppLauncherPageUI() override; |
23 | 23 |
24 static base::RefCountedMemory* GetFaviconResourceBytes( | 24 static base::RefCountedMemory* GetFaviconResourceBytes( |
25 ui::ScaleFactor scale_factor); | 25 ui::ScaleFactor scale_factor); |
26 | 26 |
27 private: | 27 private: |
28 class HTMLSource : public content::URLDataSource { | 28 class HTMLSource : public content::URLDataSource { |
29 public: | 29 public: |
30 explicit HTMLSource(Profile* profile); | 30 explicit HTMLSource(Profile* profile); |
31 virtual ~HTMLSource(); | 31 ~HTMLSource() override; |
32 | 32 |
33 // content::URLDataSource implementation. | 33 // content::URLDataSource implementation. |
34 virtual std::string GetSource() const override; | 34 std::string GetSource() const override; |
35 virtual void StartDataRequest( | 35 void StartDataRequest( |
36 const std::string& path, | 36 const std::string& path, |
37 int render_process_id, | 37 int render_process_id, |
38 int render_frame_id, | 38 int render_frame_id, |
39 const content::URLDataSource::GotDataCallback& callback) override; | 39 const content::URLDataSource::GotDataCallback& callback) override; |
40 virtual std::string GetMimeType(const std::string&) const override; | 40 std::string GetMimeType(const std::string&) const override; |
41 virtual bool ShouldReplaceExistingSource() const override; | 41 bool ShouldReplaceExistingSource() const override; |
42 virtual bool ShouldAddContentSecurityPolicy() const override; | 42 bool ShouldAddContentSecurityPolicy() const override; |
43 | 43 |
44 private: | 44 private: |
45 | 45 |
46 // Pointer back to the original profile. | 46 // Pointer back to the original profile. |
47 Profile* profile_; | 47 Profile* profile_; |
48 | 48 |
49 DISALLOW_COPY_AND_ASSIGN(HTMLSource); | 49 DISALLOW_COPY_AND_ASSIGN(HTMLSource); |
50 }; | 50 }; |
51 | 51 |
52 Profile* GetProfile() const; | 52 Profile* GetProfile() const; |
53 | 53 |
54 DISALLOW_COPY_AND_ASSIGN(AppLauncherPageUI); | 54 DISALLOW_COPY_AND_ASSIGN(AppLauncherPageUI); |
55 }; | 55 }; |
56 | 56 |
57 #endif // CHROME_BROWSER_UI_WEBUI_APP_LAUNCHER_PAGE_UI_H_ | 57 #endif // CHROME_BROWSER_UI_WEBUI_APP_LAUNCHER_PAGE_UI_H_ |
OLD | NEW |