Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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, // string id for title of experiment | |
| 329 0, // string id for description of experiment | |
|
noms (inactive)
2014/06/20 14:44:19
optional nit: Do these have to be capitalized and
| |
| 330 0, // supported platforms | |
| 331 about_flags::Experiment::ENABLE_DISABLE_VALUE, | |
| 332 switches::kEnableNewProfileManagement, | |
| 333 "", // not used with ENABLE_DISABLE_VALUE type | |
| 334 switches::kDisableNewProfileManagement, | |
| 335 "", // not used with ENABLE_DISABLE_VALUE type | |
| 336 NULL, // not used with ENABLE_DISABLE_VALUE type | |
| 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 |
| OLD | NEW |