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

Side by Side Diff: chrome/browser/profiles/profile_window.cc

Issue 343023002: When enabling new profile management programmatically, make sure to set the (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use Experiment struct Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/profiles/profile_window.h" 5 #include "chrome/browser/profiles/profile_window.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/prefs/pref_service.h" 9 #include "base/prefs/pref_service.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 } else { 314 } else {
315 chrome::ShowUserManagerWithTutorial( 315 chrome::ShowUserManagerWithTutorial(
316 profiles::USER_MANAGER_TUTORIAL_OVERVIEW); 316 profiles::USER_MANAGER_TUTORIAL_OVERVIEW);
317 } 317 }
318 } 318 }
319 319
320 void EnableNewProfileManagementPreview(Profile* profile) { 320 void EnableNewProfileManagementPreview(Profile* profile) {
321 #if defined(OS_ANDROID) 321 #if defined(OS_ANDROID)
322 NOTREACHED(); 322 NOTREACHED();
323 #else 323 #else
324 // TODO(rogerta): instead of setting experiment flags and command line
325 // args, we should set a profile preference.
326 const about_flags::Experiment experiment = {
327 kNewProfileManagementExperimentInternalName,
328 0,
guohui 2014/06/19 21:27:52 nits: probably add comments to each argument with
Roger Tawa OOO till Jul 10th 2014/06/19 22:42:46 Done.
329 0,
330 0,
331 about_flags::Experiment::ENABLE_DISABLE_VALUE,
332 switches::kEnableNewProfileManagement,
333 "",
334 switches::kDisableNewProfileManagement,
335 "",
336 NULL,
337 3
338 };
324 about_flags::PrefServiceFlagsStorage flags_storage( 339 about_flags::PrefServiceFlagsStorage flags_storage(
325 g_browser_process->local_state()); 340 g_browser_process->local_state());
326 about_flags::SetExperimentEnabled( 341 about_flags::SetExperimentEnabled(
327 &flags_storage, 342 &flags_storage,
328 kNewProfileManagementExperimentInternalName, 343 experiment.NameForChoice(1),
329 true); 344 true);
330 345
331 switches::EnableNewProfileManagementForTesting( 346 switches::EnableNewProfileManagementForTesting(
332 CommandLine::ForCurrentProcess()); 347 CommandLine::ForCurrentProcess());
333 chrome::ShowUserManagerWithTutorial(profiles::USER_MANAGER_TUTORIAL_OVERVIEW); 348 chrome::ShowUserManagerWithTutorial(profiles::USER_MANAGER_TUTORIAL_OVERVIEW);
334 UpdateServicesWithNewProfileManagementFlag(profile, true); 349 UpdateServicesWithNewProfileManagementFlag(profile, true);
335 #endif 350 #endif
336 } 351 }
337 352
338 void DisableNewProfileManagementPreview(Profile* profile) { 353 void DisableNewProfileManagementPreview(Profile* profile) {
339 about_flags::PrefServiceFlagsStorage flags_storage( 354 about_flags::PrefServiceFlagsStorage flags_storage(
340 g_browser_process->local_state()); 355 g_browser_process->local_state());
341 about_flags::SetExperimentEnabled( 356 about_flags::SetExperimentEnabled(
342 &flags_storage, 357 &flags_storage,
343 kNewProfileManagementExperimentInternalName, 358 kNewProfileManagementExperimentInternalName,
344 false); 359 false);
345 chrome::AttemptRestart(); 360 chrome::AttemptRestart();
346 UpdateServicesWithNewProfileManagementFlag(profile, false); 361 UpdateServicesWithNewProfileManagementFlag(profile, false);
347 } 362 }
348 363
349 } // namespace profiles 364 } // namespace profiles
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698