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

Side by Side Diff: chrome/browser/ui/webui/cleanup_tool/cleanup_tool_ui.cc

Issue 2784653004: Cleanup Tool WebUI: Add HTML content and styling with dummy JS (Closed)
Patch Set: Fix broken i18n commands Created 3 years, 8 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
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 #include "chrome/browser/ui/webui/cleanup_tool/cleanup_tool_ui.h" 5 #include "chrome/browser/ui/webui/cleanup_tool/cleanup_tool_ui.h"
6 6
7 #include "chrome/browser/profiles/profile.h" 7 #include "chrome/browser/profiles/profile.h"
8 #include "chrome/browser/ui/webui/cleanup_tool/cleanup_action_handler.h"
8 #include "chrome/common/url_constants.h" 9 #include "chrome/common/url_constants.h"
9 #include "chrome/grit/browser_resources.h" 10 #include "chrome/grit/browser_resources.h"
10 #include "content/public/browser/web_ui_data_source.h" 11 #include "content/public/browser/web_ui_data_source.h"
11 12
12 CleanupToolUI::CleanupToolUI(content::WebUI* web_ui) 13 CleanupToolUI::CleanupToolUI(content::WebUI* web_ui)
13 : content::WebUIController(web_ui) { 14 : content::WebUIController(web_ui) {
14 content::WebUIDataSource* html_source = 15 content::WebUIDataSource* html_source =
15 content::WebUIDataSource::Create(chrome::kChromeUICleanupToolHost); 16 content::WebUIDataSource::Create(chrome::kChromeUICleanupToolHost);
16 17
18 // TODO(proberge): Localize strings once they are finalized.
19 html_source->AddString("title", "Chrome Cleanup");
20 html_source->AddString("sectionHeader",
21 "Remove suspicious or unwanted programs");
22 html_source->AddString("scanAction", "SCAN NOW");
23 html_source->AddString("scanning", "SCANNING");
24 html_source->AddString("cleanAction", "RUN CHROME CLEANUP");
Dan Beam 2017/04/04 00:00:01 i know these are dummies, but in general the strin
proberge 2017/04/04 16:10:10 Done.
25 html_source->AddString("about", "About Chrome Cleanup");
26 html_source->SetJsonPath("strings.js");
27
28 html_source->AddResourcePath("toolbar.html", IDR_CLEANUP_TOOL_TOOLBAR_HTML);
29 html_source->AddResourcePath("toolbar.js", IDR_CLEANUP_TOOL_TOOLBAR_JS);
17 html_source->SetDefaultResource(IDR_CLEANUP_TOOL_HTML); 30 html_source->SetDefaultResource(IDR_CLEANUP_TOOL_HTML);
18 31
19 Profile* profile = Profile::FromWebUI(web_ui); 32 Profile* profile = Profile::FromWebUI(web_ui);
20 content::WebUIDataSource::Add(profile, html_source); 33 content::WebUIDataSource::Add(profile, html_source);
34
35 web_ui->AddMessageHandler(base::MakeUnique<CleanupActionHandler>());
21 } 36 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698