OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2017 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. | |
4 | |
5 #include "chrome/browser/ui/webui/webapks_ui.h" | |
6 | |
7 #include "chrome/browser/profiles/profile.h" | |
8 #include "chrome/browser/ui/webui/webapks_handler.h" | |
9 #include "chrome/common/url_constants.h" | |
10 #include "chrome/grit/chromium_strings.h" | |
11 #include "chrome/grit/generated_resources.h" | |
12 #include "components/grit/components_resources.h" | |
13 #include "components/strings/grit/components_chromium_strings.h" | |
14 #include "components/strings/grit/components_strings.h" | |
pkotwicz
2017/01/19 19:37:18
I don't think that you need any of the includes on
gonzalon
2017/01/19 23:50:17
Done.
| |
15 #include "components/webapks_ui/webapks_ui_constants.h" | |
pkotwicz
2017/01/19 19:37:18
We are getting rid of the constants file so we sho
gonzalon
2017/01/19 23:50:17
Done.
| |
16 #include "content/public/browser/url_data_source.h" | |
pkotwicz
2017/01/19 19:37:17
I don't think that you need this include
gonzalon
2017/01/19 23:50:17
Done.
| |
17 #include "content/public/browser/web_ui.h" | |
18 #include "content/public/browser/web_ui_data_source.h" | |
19 | |
20 using content::WebUIDataSource; | |
21 | |
22 namespace { | |
23 | |
24 WebUIDataSource* CreateWebApksUIDataSource() { | |
25 WebUIDataSource* html_source = | |
26 WebUIDataSource::Create(chrome::kChromeUIWebApksHost); | |
27 html_source->SetJsonPath("strings.js"); | |
28 html_source->AddResourcePath(webapks_ui::kWebApksJS, IDR_WEBAPKS_UI_JS); | |
29 html_source->AddResourcePath(webapks_ui::kAboutWebApksCSS, | |
30 IDR_WEBAPKS_UI_CSS); | |
31 html_source->SetDefaultResource(IDR_WEBAPKS_UI_HTML); | |
32 | |
33 return html_source; | |
34 } | |
35 | |
36 } // namespace | |
pkotwicz
2017/01/19 19:37:18
Nit "namespace" -> "anonymous namespace"
gonzalon
2017/01/19 23:50:17
Done.
| |
37 | |
38 WebApksUI::WebApksUI(content::WebUI* web_ui) | |
39 : content::WebUIController(web_ui) { | |
40 Profile* profile = Profile::FromWebUI(web_ui); | |
41 web_ui->AddMessageHandler(base::MakeUnique<WebApksHandler>()); | |
42 WebUIDataSource::Add(profile, CreateWebApksUIDataSource()); | |
43 } | |
44 | |
45 WebApksUI::~WebApksUI() {} | |
OLD | NEW |