Index: components/safe_browsing/web_ui/safe_browsing_ui.cc |
diff --git a/components/safe_browsing/web_ui/safe_browsing_ui.cc b/components/safe_browsing/web_ui/safe_browsing_ui.cc |
index fe19f300fa5d5a335bb19303485ec7208ec077c6..761b7cbd217c7c3b48efb4a40fe621912b217653 100644 |
--- a/components/safe_browsing/web_ui/safe_browsing_ui.cc |
+++ b/components/safe_browsing/web_ui/safe_browsing_ui.cc |
@@ -1,33 +1,21 @@ |
-// Copyright 2017 The Chromium Authors. All rights reserved. |
+// 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 "components/safe_browsing/web_ui/safe_browsing_ui.h" |
- |
-#include <algorithm> |
-#include <utility> |
-#include "base/macros.h" |
-#include "base/values.h" |
#include "components/grit/components_resources.h" |
#include "components/grit/components_scaled_resources.h" |
-#include "components/safe_browsing/features.h" |
#include "components/safe_browsing/web_ui/constants.h" |
#include "components/strings/grit/components_strings.h" |
#include "content/public/browser/browser_context.h" |
#include "content/public/browser/web_contents.h" |
#include "content/public/browser/web_ui.h" |
-#include "content/public/browser/web_ui_message_handler.h" |
-namespace safe_browsing { |
+#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( |
safe_browsing::kChromeUISafeBrowsingHost); |
- |
- // Register callback handler. |
- // Handles messages from JavaScript to C++ via chrome.send(). |
- web_ui->AddMessageHandler(base::MakeUnique<SafeBrowsingUIHandler>()); |
// Add localized string resources. |
html_source->AddLocalizedString("sbUnderConstruction", |
@@ -35,7 +23,6 @@ |
// 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); |
content::BrowserContext* browser_context = |
@@ -44,19 +31,3 @@ |
} |
SafeBrowsingUI::~SafeBrowsingUI() {} |
- |
-SafeBrowsingUIHandler::SafeBrowsingUIHandler(){}; |
- |
-void SafeBrowsingUIHandler::ExpParamList(const base::ListValue* unused) { |
- AllowJavascript(); |
- CallJavascriptFunction("safe_browsing.addExperiment", GetFeatureStatusList()); |
-} |
- |
-void SafeBrowsingUIHandler::RegisterMessages() { |
- web_ui()->RegisterMessageCallback( |
- "expParamList", |
- base::Bind(&SafeBrowsingUIHandler::ExpParamList, base::Unretained(this))); |
-} |
- |
-SafeBrowsingUIHandler::~SafeBrowsingUIHandler() {} |
-} // namespace safe_browsing |