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

Side by Side Diff: components/safe_browsing/web_ui/safe_browsing_ui.cc

Issue 2940963002: Added the chrome://safe-browsing/ page as part of the chrome://about (Closed)
Patch Set: Changed the overall location of several files to base them on components/ Created 3 years, 5 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) 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 #include "components/safe_browsing/web_ui/safe_browsing_ui.h"
5 #include "components/grit/components_resources.h"
6 #include "components/grit/components_scaled_resources.h"
7 #include "components/safe_browsing/web_ui/constants.h"
8 #include "components/strings/grit/components_strings.h"
9 #include "content/public/browser/browser_context.h"
10 #include "content/public/browser/web_contents.h"
11 #include "content/public/browser/web_ui.h"
12 #include "content/public/browser/web_ui_data_source.h"
13
14 SafeBrowsingUI::SafeBrowsingUI(content::WebUI* web_ui)
15 : content::WebUIController(web_ui) {
16 // Set up the chrome://safe-browsing source.
17 content::WebUIDataSource* html_source = content::WebUIDataSource::Create(
18 safe_browsing::kChromeUISafeBrowsingHost);
19
20 // Add localized string resources.
21 html_source->AddLocalizedString("sbUnderConstruction",
22 IDS_SB_UNDER_CONSTRUCTION);
23
24 // Add required resources.
25 html_source->AddResourcePath("safe_browsing.css", IDR_SAFE_BROWSING_CSS);
26 html_source->SetDefaultResource(IDR_SAFE_BROWSING_HTML);
vakh (use Gerrit instead) 2017/06/23 18:52:03 This line explains why the strings.js file was loa
27
28 content::BrowserContext* browser_context =
29 web_ui->GetWebContents()->GetBrowserContext();
30 content::WebUIDataSource::Add(browser_context, html_source);
vakh (use Gerrit instead) 2017/06/23 18:52:02 content::WebUIDataSource::Add(web_ui->GetWebConten
31 }
32
33 SafeBrowsingUI::~SafeBrowsingUI() {}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698