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 #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); |
| 27 |
| 28 content::BrowserContext* browser_context = |
| 29 web_ui->GetWebContents()->GetBrowserContext(); |
| 30 content::WebUIDataSource::Add(browser_context, html_source); |
| 31 } |
| 32 |
| 33 SafeBrowsingUI::~SafeBrowsingUI() {} |
OLD | NEW |