OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/ui/webui/settings/safe_browsing_handler.h" | 5 #include "chrome/browser/ui/webui/settings/safe_browsing_handler.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 #include "components/prefs/pref_service.h" | 10 #include "components/prefs/pref_service.h" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 CHECK(args->GetBoolean(0, &enabled)); | 57 CHECK(args->GetBoolean(0, &enabled)); |
58 safe_browsing::SetExtendedReportingPrefAndMetric( | 58 safe_browsing::SetExtendedReportingPrefAndMetric( |
59 prefs_, enabled, safe_browsing::SBER_OPTIN_SITE_CHROME_SETTINGS); | 59 prefs_, enabled, safe_browsing::SBER_OPTIN_SITE_CHROME_SETTINGS); |
60 } | 60 } |
61 | 61 |
62 void SafeBrowsingHandler::OnPrefChanged(const std::string& pref_name) { | 62 void SafeBrowsingHandler::OnPrefChanged(const std::string& pref_name) { |
63 DCHECK(pref_name == prefs::kSafeBrowsingExtendedReportingEnabled || | 63 DCHECK(pref_name == prefs::kSafeBrowsingExtendedReportingEnabled || |
64 pref_name == prefs::kSafeBrowsingScoutReportingEnabled); | 64 pref_name == prefs::kSafeBrowsingScoutReportingEnabled); |
65 | 65 |
66 base::Value is_enabled(safe_browsing::IsExtendedReportingEnabled(*prefs_)); | 66 base::Value is_enabled(safe_browsing::IsExtendedReportingEnabled(*prefs_)); |
67 CallJavascriptFunction( | 67 CallJavascriptFunction("cr.webUIListenerCallback", |
68 "cr.webUIListenerCallback", | 68 base::Value("safe-browsing-extended-reporting-change"), |
69 base::StringValue("safe-browsing-extended-reporting-change"), is_enabled); | 69 is_enabled); |
70 } | 70 } |
71 | 71 |
72 } // namespace settings | 72 } // namespace settings |
OLD | NEW |