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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_UI_WEBUI_APP_LAUNCHER_PAGE_UI_H_
6 #define CHROME_BROWSER_UI_WEBUI_APP_LAUNCHER_PAGE_UI_H_
8 #include "content/public/browser/url_data_source.h"
9 #include "content/public/browser/web_ui_controller.h"
10 #include "ui/base/layout.h"
15 class RefCountedMemory
;
18 // The WebUIController used for the app launcher page UI.
19 class AppLauncherPageUI
: public content::WebUIController
{
21 explicit AppLauncherPageUI(content::WebUI
* web_ui
);
22 ~AppLauncherPageUI() override
;
24 static base::RefCountedMemory
* GetFaviconResourceBytes(
25 ui::ScaleFactor scale_factor
);
27 // content::WebUIController:
28 bool OverrideHandleWebUIMessage(const GURL
& source_url
,
29 const std::string
& message
,
30 const base::ListValue
& args
) override
;
33 class HTMLSource
: public content::URLDataSource
{
35 explicit HTMLSource(Profile
* profile
);
36 ~HTMLSource() override
;
38 // content::URLDataSource implementation.
39 std::string
GetSource() const override
;
40 void StartDataRequest(
41 const std::string
& path
,
42 int render_process_id
,
44 const content::URLDataSource::GotDataCallback
& callback
) override
;
45 std::string
GetMimeType(const std::string
&) const override
;
46 bool ShouldReplaceExistingSource() const override
;
47 bool ShouldAddContentSecurityPolicy() const override
;
51 // Pointer back to the original profile.
54 DISALLOW_COPY_AND_ASSIGN(HTMLSource
);
57 Profile
* GetProfile() const;
59 DISALLOW_COPY_AND_ASSIGN(AppLauncherPageUI
);
62 #endif // CHROME_BROWSER_UI_WEBUI_APP_LAUNCHER_PAGE_UI_H_