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

Unified Diff: chrome/browser/ui/webui/safe_browsing_ui.cc

Issue 2940963002: Added the chrome://safe-browsing/ page as part of the chrome://about (Closed)
Patch Set: Created 3 years, 6 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 side-by-side diff with in-line comments
Download patch
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() {}

Powered by Google App Engine
This is Rietveld 408576698