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 | |
5 #include "chrome/browser/ui/webui/safe_browsing_ui.h" | |
6 | |
7 #include "chrome/browser/profiles/profile.h" | |
8 #include "chrome/common/url_constants.h" | |
9 #include "chrome/grit/browser_resources.h" | |
10 #include "chrome/grit/generated_resources.h" | |
11 #include "content/public/browser/web_ui_data_source.h" | |
12 | |
13 SafeBrowsingUI::SafeBrowsingUI(content::WebUI* web_ui) | |
14 : content::WebUIController(web_ui) { | |
15 // Set up the chrome://safe-browsing source. | |
16 content::WebUIDataSource* html_source = | |
17 content::WebUIDataSource::Create(chrome::kChromeUISafeBrowsingHost); | |
18 | |
19 // Add required resources. | |
20 html_source->AddResourcePath("safe_browsing.css", IDR_SAFE_BROWSING_CSS); | |
21 html_source->AddResourcePath("safe_browsing.js", IDR_SAFE_BROWSING_JS); | |
22 html_source->SetDefaultResource(IDR_SAFE_BROWSING_HTML); | |
23 | |
24 Profile* profile = Profile::FromWebUI(web_ui); | |
25 content::WebUIDataSource::Add(profile, html_source); | |
vakh (use Gerrit instead)
2017/06/15 22:51:14
Does it mean that we can't open it in an Incognito
hkamila
2017/06/16 20:53:24
Addressed this in patch #3.
| |
26 } | |
27 | |
28 SafeBrowsingUI::~SafeBrowsingUI() {} | |
OLD | NEW |