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

Side by Side Diff: chrome/browser/bookmarks/enhanced_bookmarks_features.cc

Issue 517713002: [Android] Add enhanced bookmark opt-in flag. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/bookmarks/enhanced_bookmarks_features.h" 5 #include "chrome/browser/bookmarks/enhanced_bookmarks_features.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "base/prefs/pref_service.h" 9 #include "base/prefs/pref_service.h"
10 #include "base/prefs/scoped_user_pref_update.h" 10 #include "base/prefs/scoped_user_pref_update.h"
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 BOOKMARKS_EXPERIMENT_ENABLED_USER_OPT_OUT) { 122 BOOKMARKS_EXPERIMENT_ENABLED_USER_OPT_OUT) {
123 if (opt_out) { 123 if (opt_out) {
124 bookmarks_experiment_new_state = 124 bookmarks_experiment_new_state =
125 BOOKMARKS_EXPERIMENT_ENABLED_USER_OPT_OUT; 125 BOOKMARKS_EXPERIMENT_ENABLED_USER_OPT_OUT;
126 } else { 126 } else {
127 // User opted in again. 127 // User opted in again.
128 bookmarks_experiment_new_state = BOOKMARKS_EXPERIMENT_ENABLED; 128 bookmarks_experiment_new_state = BOOKMARKS_EXPERIMENT_ENABLED;
129 } 129 }
130 } 130 }
131 131
132 #if defined(OS_ANDROID)
133 bool opt_in = !opt_out
134 && CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
135 switches::kEnhancedBookmarksExperiment) == "1";
136 if (opt_in && bookmarks_experiment_new_state == BOOKMARKS_EXPERIMENT_NONE)
137 bookmarks_experiment_new_state = BOOKMARKS_EXPERIMENT_ENABLED;
138 #endif
139
132 UMA_HISTOGRAM_ENUMERATION("EnhancedBookmarks.SyncExperimentState", 140 UMA_HISTOGRAM_ENUMERATION("EnhancedBookmarks.SyncExperimentState",
133 bookmarks_experiment_new_state, 141 bookmarks_experiment_new_state,
134 BOOKMARKS_EXPERIMENT_ENUM_SIZE); 142 BOOKMARKS_EXPERIMENT_ENUM_SIZE);
135 user_prefs->SetInteger( 143 user_prefs->SetInteger(
136 sync_driver::prefs::kEnhancedBookmarksExperimentEnabled, 144 sync_driver::prefs::kEnhancedBookmarksExperimentEnabled,
137 bookmarks_experiment_new_state); 145 bookmarks_experiment_new_state);
138 ForceFinchBookmarkExperimentIfNeeded(flags_storage, 146 ForceFinchBookmarkExperimentIfNeeded(flags_storage,
139 bookmarks_experiment_new_state); 147 bookmarks_experiment_new_state);
140 } 148 }
141 149
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 if (CommandLine::ForCurrentProcess()-> 226 if (CommandLine::ForCurrentProcess()->
219 HasSwitch(switches::kEnableSyncArticles)) { 227 HasSwitch(switches::kEnableSyncArticles)) {
220 return true; 228 return true;
221 } 229 }
222 if (variations::GetVariationParamValue( 230 if (variations::GetVariationParamValue(
223 kFieldTrialName, "enable-sync-articles") == "1") 231 kFieldTrialName, "enable-sync-articles") == "1")
224 return true; 232 return true;
225 233
226 return false; 234 return false;
227 } 235 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698