Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(168)

Side by Side Diff: chrome/browser/ui/webui/webapks_ui.cc

Issue 2629573004: Add a chrome://webapks page. (Closed)
Patch Set: Adds an about:webapks page with information about all installed Web APKs on the device Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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() {}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698