Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/ui/startup/startup_browser_creator.h" | 5 #include "chrome/browser/ui/startup/startup_browser_creator.h" |
| 6 | 6 |
| 7 #include <algorithm> // For max(). | 7 #include <algorithm> // For max(). |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "apps/app_load_service.h" | 10 #include "apps/app_load_service.h" |
| (...skipping 728 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 739 | 739 |
| 740 // The profile isn't loaded yet and so needs to be loaded asynchronously. | 740 // The profile isn't loaded yet and so needs to be loaded asynchronously. |
| 741 if (!profile) { | 741 if (!profile) { |
| 742 profile_manager->CreateProfileAsync(profile_path, | 742 profile_manager->CreateProfileAsync(profile_path, |
| 743 base::Bind(&StartupBrowserCreator::ProcessCommandLineOnProfileCreated, | 743 base::Bind(&StartupBrowserCreator::ProcessCommandLineOnProfileCreated, |
| 744 command_line, cur_dir), base::string16(), base::string16(), | 744 command_line, cur_dir), base::string16(), base::string16(), |
| 745 std::string()); | 745 std::string()); |
| 746 return; | 746 return; |
| 747 } | 747 } |
| 748 | 748 |
| 749 if (command_line.HasSwitch(switches::kActivateExistingProfileBrowser)) { | |
|
tapted
2014/11/04 23:10:48
nit: perhaps comment here, something like "If the
noms (inactive)
2014/11/10 21:46:08
Done.
| |
| 750 Browser* browser = chrome::FindTabbedBrowser( | |
| 751 profile, false, chrome::HOST_DESKTOP_TYPE_NATIVE); | |
| 752 if (browser) { | |
| 753 browser->window()->Activate(); | |
| 754 return; | |
| 755 } | |
| 756 } | |
| 757 | |
| 749 ProcessCmdLineImpl(command_line, cur_dir, false, profile, Profiles(), NULL, | 758 ProcessCmdLineImpl(command_line, cur_dir, false, profile, Profiles(), NULL, |
| 750 NULL); | 759 NULL); |
| 751 } | 760 } |
| 752 | 761 |
| 753 // static | 762 // static |
| 754 bool StartupBrowserCreator::ActivatedProfile() { | 763 bool StartupBrowserCreator::ActivatedProfile() { |
| 755 return profile_launch_observer.Get().activated_profile(); | 764 return profile_launch_observer.Get().activated_profile(); |
| 756 } | 765 } |
| 757 | 766 |
| 758 bool HasPendingUncleanExit(Profile* profile) { | 767 bool HasPendingUncleanExit(Profile* profile) { |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 770 // If we are showing the app list then chrome isn't shown so load the app | 779 // If we are showing the app list then chrome isn't shown so load the app |
| 771 // list's profile rather than chrome's. | 780 // list's profile rather than chrome's. |
| 772 if (command_line.HasSwitch(switches::kShowAppList)) { | 781 if (command_line.HasSwitch(switches::kShowAppList)) { |
| 773 return AppListService::Get(chrome::HOST_DESKTOP_TYPE_NATIVE)-> | 782 return AppListService::Get(chrome::HOST_DESKTOP_TYPE_NATIVE)-> |
| 774 GetProfilePath(user_data_dir); | 783 GetProfilePath(user_data_dir); |
| 775 } | 784 } |
| 776 | 785 |
| 777 return g_browser_process->profile_manager()->GetLastUsedProfileDir( | 786 return g_browser_process->profile_manager()->GetLastUsedProfileDir( |
| 778 user_data_dir); | 787 user_data_dir); |
| 779 } | 788 } |
| OLD | NEW |