OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
hartmanng
2017/01/13 15:40:21
s/(c) 2012/2017/
gonzalon
2017/01/13 20:24:39
Done.
| |
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 "base/android/build_info.h" | |
hartmanng
2017/01/13 15:40:21
lots of includes again, you might be able to remov
gonzalon
2017/01/13 20:24:39
Done.
| |
8 #include "base/i18n/message_formatter.h" | |
9 #include "build/build_config.h" | |
10 #include "chrome/browser/profiles/profile.h" | |
11 #include "chrome/browser/ui/android/android_about_app_info.h" | |
12 #include "chrome/browser/ui/webui/webapks_handler.h" | |
13 #include "chrome/common/url_constants.h" | |
14 #include "chrome/grit/browser_resources.h" | |
15 #include "chrome/grit/chromium_strings.h" | |
16 #include "chrome/grit/generated_resources.h" | |
17 #include "components/grit/components_resources.h" | |
18 #include "components/strings/grit/components_chromium_strings.h" | |
19 #include "components/strings/grit/components_strings.h" | |
20 #include "components/webapks_ui/webapks_ui_constants.h" | |
21 #include "content/public/browser/url_data_source.h" | |
22 #include "content/public/browser/web_ui.h" | |
23 #include "content/public/browser/web_ui_data_source.h" | |
24 #include "ui/base/l10n/l10n_util.h" | |
25 | |
26 using content::WebUIDataSource; | |
27 | |
28 namespace { | |
29 | |
30 WebUIDataSource* CreateWebAPKsUIDataSource() { | |
31 WebUIDataSource* html_source = | |
32 WebUIDataSource::Create(chrome::kChromeUIWebAPKsHost); | |
33 | |
34 html_source->AddLocalizedString(webapks_ui::kTitle, IDS_WEBAPKS_UI_TITLE); | |
35 html_source->AddLocalizedString(webapks_ui::kHeader, IDS_WEBAPKS_UI_HEADER); | |
36 html_source->AddLocalizedString(webapks_ui::kPackageName, | |
37 IDS_WEBAPKS_UI_PACKAGE_NAME); | |
38 html_source->AddLocalizedString(webapks_ui::kShellApkVersion, | |
39 IDS_WEBAPKS_UI_SHELL_APK_VERSION); | |
40 html_source->AddLocalizedString(webapks_ui::kVersionCode, | |
41 IDS_WEBAPKS_UI_VERSION_CODE); | |
42 | |
43 html_source->SetJsonPath("strings.js"); | |
44 html_source->AddResourcePath(webapks_ui::kWebAPKsJS, IDR_WEBAPKS_UI_JS); | |
45 html_source->AddResourcePath(webapks_ui::kAboutWebAPKsCSS, | |
46 IDR_WEBAPKS_UI_CSS); | |
47 html_source->SetDefaultResource(IDR_WEBAPKS_UI_HTML); | |
48 | |
49 return html_source; | |
50 } | |
51 | |
52 } // namespace | |
53 | |
54 WebAPKsUI::WebAPKsUI(content::WebUI* web_ui) | |
55 : content::WebUIController(web_ui) { | |
56 Profile* profile = Profile::FromWebUI(web_ui); | |
57 web_ui->AddMessageHandler(base::MakeUnique<WebAPKsHandler>()); | |
58 WebUIDataSource::Add(profile, CreateWebAPKsUIDataSource()); | |
59 } | |
60 | |
61 WebAPKsUI::~WebAPKsUI() {} | |
OLD | NEW |