| 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 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 | 250 |
| 251 if (!always_create) { | 251 if (!always_create) { |
| 252 Browser* browser = chrome::FindTabbedBrowser(profile, false, desktop_type); | 252 Browser* browser = chrome::FindTabbedBrowser(profile, false, desktop_type); |
| 253 if (browser) { | 253 if (browser) { |
| 254 browser->window()->Activate(); | 254 browser->window()->Activate(); |
| 255 return; | 255 return; |
| 256 } | 256 } |
| 257 } | 257 } |
| 258 | 258 |
| 259 content::RecordAction(UserMetricsAction("NewWindow")); | 259 content::RecordAction(UserMetricsAction("NewWindow")); |
| 260 CommandLine command_line(CommandLine::NO_PROGRAM); | 260 base::CommandLine command_line(base::CommandLine::NO_PROGRAM); |
| 261 int return_code; | 261 int return_code; |
| 262 StartupBrowserCreator browser_creator; | 262 StartupBrowserCreator browser_creator; |
| 263 browser_creator.LaunchBrowser(command_line, profile, base::FilePath(), | 263 browser_creator.LaunchBrowser(command_line, profile, base::FilePath(), |
| 264 process_startup, is_first_run, &return_code); | 264 process_startup, is_first_run, &return_code); |
| 265 #endif // defined(OS_IOS) | 265 #endif // defined(OS_IOS) |
| 266 } | 266 } |
| 267 | 267 |
| 268 void SwitchToProfile(const base::FilePath& path, | 268 void SwitchToProfile(const base::FilePath& path, |
| 269 chrome::HostDesktopType desktop_type, | 269 chrome::HostDesktopType desktop_type, |
| 270 bool always_create, | 270 bool always_create, |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 3 | 448 3 |
| 449 }; | 449 }; |
| 450 about_flags::PrefServiceFlagsStorage flags_storage( | 450 about_flags::PrefServiceFlagsStorage flags_storage( |
| 451 g_browser_process->local_state()); | 451 g_browser_process->local_state()); |
| 452 about_flags::SetExperimentEnabled( | 452 about_flags::SetExperimentEnabled( |
| 453 &flags_storage, | 453 &flags_storage, |
| 454 experiment.NameForChoice(1), | 454 experiment.NameForChoice(1), |
| 455 true); | 455 true); |
| 456 | 456 |
| 457 switches::EnableNewProfileManagementForTesting( | 457 switches::EnableNewProfileManagementForTesting( |
| 458 CommandLine::ForCurrentProcess()); | 458 base::CommandLine::ForCurrentProcess()); |
| 459 UserManager::Show(base::FilePath(), | 459 UserManager::Show(base::FilePath(), |
| 460 profiles::USER_MANAGER_TUTORIAL_OVERVIEW, | 460 profiles::USER_MANAGER_TUTORIAL_OVERVIEW, |
| 461 profiles::USER_MANAGER_SELECT_PROFILE_NO_ACTION); | 461 profiles::USER_MANAGER_SELECT_PROFILE_NO_ACTION); |
| 462 UpdateServicesWithNewProfileManagementFlag(profile, true); | 462 UpdateServicesWithNewProfileManagementFlag(profile, true); |
| 463 #endif | 463 #endif |
| 464 } | 464 } |
| 465 | 465 |
| 466 void DisableNewProfileManagementPreview(Profile* profile) { | 466 void DisableNewProfileManagementPreview(Profile* profile) { |
| 467 about_flags::PrefServiceFlagsStorage flags_storage( | 467 about_flags::PrefServiceFlagsStorage flags_storage( |
| 468 g_browser_process->local_state()); | 468 g_browser_process->local_state()); |
| (...skipping 30 matching lines...) Expand all Loading... |
| 499 case BrowserWindow::AVATAR_BUBBLE_MODE_SHOW_ERROR: | 499 case BrowserWindow::AVATAR_BUBBLE_MODE_SHOW_ERROR: |
| 500 *bubble_view_mode = BUBBLE_VIEW_MODE_PROFILE_CHOOSER; | 500 *bubble_view_mode = BUBBLE_VIEW_MODE_PROFILE_CHOOSER; |
| 501 *tutorial_mode = TUTORIAL_MODE_SHOW_ERROR; | 501 *tutorial_mode = TUTORIAL_MODE_SHOW_ERROR; |
| 502 return; | 502 return; |
| 503 default: | 503 default: |
| 504 *bubble_view_mode = profiles::BUBBLE_VIEW_MODE_PROFILE_CHOOSER; | 504 *bubble_view_mode = profiles::BUBBLE_VIEW_MODE_PROFILE_CHOOSER; |
| 505 } | 505 } |
| 506 } | 506 } |
| 507 | 507 |
| 508 } // namespace profiles | 508 } // namespace profiles |
| OLD | NEW |