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 605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 616 | 616 |
| 617 // Return early here since we don't want to open a browser window. | 617 // Return early here since we don't want to open a browser window. |
| 618 // The exception is when there are no browser windows, since we don't want | 618 // The exception is when there are no browser windows, since we don't want |
| 619 // chrome to shut down. | 619 // chrome to shut down. |
| 620 // TODO(jackhou): Do this properly once keep-alive is handled by the | 620 // TODO(jackhou): Do this properly once keep-alive is handled by the |
| 621 // background page of apps. Tracked at http://crbug.com/175381 | 621 // background page of apps. Tracked at http://crbug.com/175381 |
| 622 if (chrome::GetTotalBrowserCountForProfile(last_used_profile) != 0) | 622 if (chrome::GetTotalBrowserCountForProfile(last_used_profile) != 0) |
| 623 return true; | 623 return true; |
| 624 } | 624 } |
| 625 | 625 |
| 626 if (command_line.HasSwitch(switches::kReuseExistingProfileBrowser)) { | |
|
tapted
2014/11/03 23:57:06
an OWNER here might have a different opinion, but
noms (inactive)
2014/11/04 20:03:09
Done.
| |
| 627 Browser* browser = chrome::FindTabbedBrowser(last_used_profile, false, | |
|
tapted
2014/11/03 23:57:06
nit: one arg per line.
noms (inactive)
2014/11/04 20:03:09
Done.
| |
| 628 chrome::HOST_DESKTOP_TYPE_NATIVE); | |
| 629 if (browser) { | |
| 630 browser->window()->Activate(); | |
| 631 return true; | |
| 632 } | |
| 633 } | |
| 634 | |
| 626 chrome::startup::IsProcessStartup is_process_startup = process_startup ? | 635 chrome::startup::IsProcessStartup is_process_startup = process_startup ? |
| 627 chrome::startup::IS_PROCESS_STARTUP : | 636 chrome::startup::IS_PROCESS_STARTUP : |
| 628 chrome::startup::IS_NOT_PROCESS_STARTUP; | 637 chrome::startup::IS_NOT_PROCESS_STARTUP; |
| 629 chrome::startup::IsFirstRun is_first_run = first_run::IsChromeFirstRun() ? | 638 chrome::startup::IsFirstRun is_first_run = first_run::IsChromeFirstRun() ? |
| 630 chrome::startup::IS_FIRST_RUN : chrome::startup::IS_NOT_FIRST_RUN; | 639 chrome::startup::IS_FIRST_RUN : chrome::startup::IS_NOT_FIRST_RUN; |
| 631 // |last_opened_profiles| will be empty in the following circumstances: | 640 // |last_opened_profiles| will be empty in the following circumstances: |
| 632 // - This is the first launch. |last_used_profile| is the initial profile. | 641 // - This is the first launch. |last_used_profile| is the initial profile. |
| 633 // - The user exited the browser by closing all windows for all | 642 // - The user exited the browser by closing all windows for all |
| 634 // profiles. |last_used_profile| is the profile which owned the last open | 643 // profiles. |last_used_profile| is the profile which owned the last open |
| 635 // window. | 644 // window. |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after 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 |