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

Unified Diff: chrome/browser/ui/webui/options/core_options_handler.cc

Issue 506663003: Consolidates accessing and setting the UMA pref to be within metrics code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Always pass all params to setMetricsReportingCheckboxState, minor changes Created 6 years, 3 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/options/core_options_handler.cc
diff --git a/chrome/browser/ui/webui/options/core_options_handler.cc b/chrome/browser/ui/webui/options/core_options_handler.cc
index b7bc0ff5911135a5a7df5a61a06a23ef223e4046..1908440c573049ed9ff357fa55b5c07fe9235596 100644
--- a/chrome/browser/ui/webui/options/core_options_handler.cc
+++ b/chrome/browser/ui/webui/options/core_options_handler.cc
@@ -6,6 +6,7 @@
#include "base/bind.h"
#include "base/bind_helpers.h"
+#include "base/callback.h"
#include "base/json/json_reader.h"
#include "base/memory/scoped_ptr.h"
#include "base/strings/string16.h"
@@ -16,7 +17,6 @@
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/extensions/extension_util.h"
-#include "chrome/browser/metrics/metrics_reporting_state.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h"
@@ -43,18 +43,6 @@ namespace options {
namespace {
-// Only allow changes to the metrics reporting checkbox if we were succesfully
-// able to change the service.
-bool AllowMetricsReportingChange(const base::Value* to_value) {
- bool enable;
- if (!to_value->GetAsBoolean(&enable)) {
- NOTREACHED();
- return false;
- }
-
- return enable == ResolveMetricsReportingEnabled(enable);
-}
-
// Whether "controlledBy" property of pref value sent to options web UI needs to
// be set to "extension" when the preference is controlled by an extension.
bool CanSetExtensionControlledPrefValue(
@@ -89,9 +77,6 @@ void CoreOptionsHandler::InitializeHandler() {
base::Bind(&CoreOptionsHandler::OnPreferenceChanged,
base::Unretained(this),
profile->GetPrefs()));
-
- pref_change_filters_[prefs::kMetricsReportingEnabled] =
- base::Bind(&AllowMetricsReportingChange);
}
void CoreOptionsHandler::InitializePage() {

Powered by Google App Engine
This is Rietveld 408576698