Index: chrome/browser/ui/webui/safe_browsing_ui.cc |
diff --git a/chrome/browser/ui/webui/safe_browsing_ui.cc b/chrome/browser/ui/webui/safe_browsing_ui.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..fe587da28f7f64370107b0a590ff21a9b1e0db20 |
--- /dev/null |
+++ b/chrome/browser/ui/webui/safe_browsing_ui.cc |
@@ -0,0 +1,28 @@ |
+// Copyright (c) 2017 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "chrome/browser/ui/webui/safe_browsing_ui.h" |
+ |
+#include "chrome/browser/profiles/profile.h" |
+#include "chrome/common/url_constants.h" |
+#include "chrome/grit/browser_resources.h" |
+#include "chrome/grit/generated_resources.h" |
+#include "content/public/browser/web_ui_data_source.h" |
+ |
+SafeBrowsingUI::SafeBrowsingUI(content::WebUI* web_ui) |
+ : content::WebUIController(web_ui) { |
+ // Set up the chrome://safe-browsing source. |
+ content::WebUIDataSource* html_source = |
+ content::WebUIDataSource::Create(chrome::kChromeUISafeBrowsingHost); |
+ |
+ // Add required resources. |
+ html_source->AddResourcePath("safe_browsing.css", IDR_SAFE_BROWSING_CSS); |
+ html_source->AddResourcePath("safe_browsing.js", IDR_SAFE_BROWSING_JS); |
+ html_source->SetDefaultResource(IDR_SAFE_BROWSING_HTML); |
+ |
+ Profile* profile = Profile::FromWebUI(web_ui); |
+ 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.
|
+} |
+ |
+SafeBrowsingUI::~SafeBrowsingUI() {} |