| 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" |
| 11 #include "base/strings/utf_string_conversions.h" | 11 #include "base/strings/utf_string_conversions.h" |
| 12 #include "chrome/browser/about_flags.h" | 12 #include "chrome/browser/about_flags.h" |
| 13 #include "chrome/browser/browser_process.h" | 13 #include "chrome/browser/browser_process.h" |
| 14 #include "chrome/browser/lifetime/application_lifetime.h" | 14 #include "chrome/browser/lifetime/application_lifetime.h" |
| 15 #include "chrome/browser/pref_service_flags_storage.h" | 15 #include "chrome/browser/pref_service_flags_storage.h" |
| 16 #include "chrome/browser/profiles/profile.h" | 16 #include "chrome/browser/profiles/profile.h" |
| 17 #include "chrome/browser/profiles/profile_avatar_icon_util.h" | 17 #include "chrome/browser/profiles/profile_avatar_icon_util.h" |
| 18 #include "chrome/browser/profiles/profile_manager.h" | 18 #include "chrome/browser/profiles/profile_manager.h" |
| 19 #include "chrome/browser/ui/browser.h" | 19 #include "chrome/browser/ui/browser.h" |
| 20 #include "chrome/browser/ui/browser_dialogs.h" | 20 #include "chrome/browser/ui/browser_dialogs.h" |
| 21 #include "chrome/common/chrome_switches.h" | 21 #include "chrome/common/chrome_switches.h" |
| 22 #include "chrome/common/pref_names.h" | 22 #include "chrome/common/pref_names.h" |
| 23 #include "chrome/common/url_constants.h" | 23 #include "chrome/common/url_constants.h" |
| 24 #include "components/signin/core/common/profile_management_switches.h" |
| 24 #include "content/public/browser/browser_thread.h" | 25 #include "content/public/browser/browser_thread.h" |
| 25 #include "content/public/browser/user_metrics.h" | 26 #include "content/public/browser/user_metrics.h" |
| 26 | 27 |
| 27 #if !defined(OS_IOS) | 28 #if !defined(OS_IOS) |
| 28 #include "chrome/browser/ui/browser_finder.h" | 29 #include "chrome/browser/ui/browser_finder.h" |
| 29 #include "chrome/browser/ui/browser_list.h" | 30 #include "chrome/browser/ui/browser_list.h" |
| 30 #include "chrome/browser/ui/browser_list_observer.h" | 31 #include "chrome/browser/ui/browser_list_observer.h" |
| 31 #include "chrome/browser/ui/browser_window.h" | 32 #include "chrome/browser/ui/browser_window.h" |
| 32 #include "chrome/browser/ui/startup/startup_browser_creator.h" | 33 #include "chrome/browser/ui/startup/startup_browser_creator.h" |
| 33 #endif // !defined (OS_IOS) | 34 #endif // !defined (OS_IOS) |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 } | 307 } |
| 307 | 308 |
| 308 void EnableNewProfileManagementPreview() { | 309 void EnableNewProfileManagementPreview() { |
| 309 about_flags::PrefServiceFlagsStorage flags_storage( | 310 about_flags::PrefServiceFlagsStorage flags_storage( |
| 310 g_browser_process->local_state()); | 311 g_browser_process->local_state()); |
| 311 about_flags::SetExperimentEnabled( | 312 about_flags::SetExperimentEnabled( |
| 312 &flags_storage, | 313 &flags_storage, |
| 313 kNewProfileManagementExperimentInternalName, | 314 kNewProfileManagementExperimentInternalName, |
| 314 true); | 315 true); |
| 315 | 316 |
| 316 CommandLine::ForCurrentProcess()->AppendSwitch( | 317 switches::EnableNewProfileManagementForTesting( |
| 317 switches::kNewProfileManagement); | 318 CommandLine::ForCurrentProcess()); |
| 318 chrome::ShowUserManagerWithTutorial(profiles::USER_MANAGER_TUTORIAL_OVERVIEW); | 319 chrome::ShowUserManagerWithTutorial(profiles::USER_MANAGER_TUTORIAL_OVERVIEW); |
| 319 } | 320 } |
| 320 | 321 |
| 321 void DisableNewProfileManagementPreview() { | 322 void DisableNewProfileManagementPreview() { |
| 322 about_flags::PrefServiceFlagsStorage flags_storage( | 323 about_flags::PrefServiceFlagsStorage flags_storage( |
| 323 g_browser_process->local_state()); | 324 g_browser_process->local_state()); |
| 324 about_flags::SetExperimentEnabled( | 325 about_flags::SetExperimentEnabled( |
| 325 &flags_storage, | 326 &flags_storage, |
| 326 kNewProfileManagementExperimentInternalName, | 327 kNewProfileManagementExperimentInternalName, |
| 327 false); | 328 false); |
| 328 chrome::AttemptRestart(); | 329 chrome::AttemptRestart(); |
| 329 } | 330 } |
| 330 | 331 |
| 331 } // namespace profiles | 332 } // namespace profiles |
| OLD | NEW |