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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
80 #endif | 80 #endif |
81 | 81 |
82 #if defined(TOOLKIT_VIEWS) && defined(OS_LINUX) | 82 #if defined(TOOLKIT_VIEWS) && defined(OS_LINUX) |
83 #include "ui/events/devices/x11/touch_factory_x11.h" | 83 #include "ui/events/devices/x11/touch_factory_x11.h" |
84 #endif | 84 #endif |
85 | 85 |
86 #if defined(OS_MACOSX) | 86 #if defined(OS_MACOSX) |
87 #include "chrome/browser/web_applications/web_app_mac.h" | 87 #include "chrome/browser/web_applications/web_app_mac.h" |
88 #endif | 88 #endif |
89 | 89 |
90 #if defined(OS_WIN) | |
91 #include "chrome/browser/metrics/jumplist_metrics_win.h" | |
92 #endif | |
93 | |
90 #if defined(ENABLE_PRINT_PREVIEW) | 94 #if defined(ENABLE_PRINT_PREVIEW) |
91 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service.h" | 95 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service.h" |
92 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service_factory. h" | 96 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service_factory. h" |
93 #include "chrome/browser/printing/print_dialog_cloud.h" | 97 #include "chrome/browser/printing/print_dialog_cloud.h" |
94 #endif | 98 #endif |
95 | 99 |
96 using content::BrowserThread; | 100 using content::BrowserThread; |
97 using content::ChildProcessSecurityPolicy; | 101 using content::ChildProcessSecurityPolicy; |
98 | 102 |
99 namespace { | 103 namespace { |
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
620 | 624 |
621 // Return early here since we don't want to open a browser window. | 625 // Return early here since we don't want to open a browser window. |
622 // The exception is when there are no browser windows, since we don't want | 626 // The exception is when there are no browser windows, since we don't want |
623 // chrome to shut down. | 627 // chrome to shut down. |
624 // TODO(jackhou): Do this properly once keep-alive is handled by the | 628 // TODO(jackhou): Do this properly once keep-alive is handled by the |
625 // background page of apps. Tracked at http://crbug.com/175381 | 629 // background page of apps. Tracked at http://crbug.com/175381 |
626 if (chrome::GetTotalBrowserCountForProfile(last_used_profile) != 0) | 630 if (chrome::GetTotalBrowserCountForProfile(last_used_profile) != 0) |
627 return true; | 631 return true; |
628 } | 632 } |
629 | 633 |
634 | |
635 #if defined(OS_WIN) | |
636 // Log whether this process was a result of an action in the Windows Jumplist. | |
637 if (command_line.HasSwitch(switches::kWinJumplistAction)) { | |
638 jumplist::LogJumplistActionFromSwitchValue( | |
639 command_line.GetSwitchValueASCII(switches::kWinJumplistAction)); | |
sky
2014/11/13 00:17:11
Should the command line switch get removed so that
noms (inactive)
2014/11/13 16:59:55
Ah. I found where to do it correctly -- there's a
| |
640 } | |
641 #endif | |
642 | |
643 // If the profile is loaded and the --activate-existing-profile-browser flag | |
644 // is used, activate one of the profile's browser windows, if one exists. | |
645 // Continuing to process the command line is not needed, since this will | |
646 // end up opening a new browser window. | |
647 if (command_line.HasSwitch(switches::kActivateExistingProfileBrowser)) { | |
648 Browser* browser = chrome::FindTabbedBrowser( | |
649 last_used_profile, false, chrome::HOST_DESKTOP_TYPE_NATIVE); | |
650 if (browser) { | |
651 browser->window()->Activate(); | |
652 return true; | |
653 } | |
654 } | |
655 | |
630 VLOG(2) << "ProcessCmdLineImpl: PLACE 5"; | 656 VLOG(2) << "ProcessCmdLineImpl: PLACE 5"; |
631 chrome::startup::IsProcessStartup is_process_startup = process_startup ? | 657 chrome::startup::IsProcessStartup is_process_startup = process_startup ? |
632 chrome::startup::IS_PROCESS_STARTUP : | 658 chrome::startup::IS_PROCESS_STARTUP : |
633 chrome::startup::IS_NOT_PROCESS_STARTUP; | 659 chrome::startup::IS_NOT_PROCESS_STARTUP; |
634 chrome::startup::IsFirstRun is_first_run = first_run::IsChromeFirstRun() ? | 660 chrome::startup::IsFirstRun is_first_run = first_run::IsChromeFirstRun() ? |
635 chrome::startup::IS_FIRST_RUN : chrome::startup::IS_NOT_FIRST_RUN; | 661 chrome::startup::IS_FIRST_RUN : chrome::startup::IS_NOT_FIRST_RUN; |
636 // |last_opened_profiles| will be empty in the following circumstances: | 662 // |last_opened_profiles| will be empty in the following circumstances: |
637 // - This is the first launch. |last_used_profile| is the initial profile. | 663 // - This is the first launch. |last_used_profile| is the initial profile. |
638 // - The user exited the browser by closing all windows for all | 664 // - The user exited the browser by closing all windows for all |
639 // profiles. |last_used_profile| is the profile which owned the last open | 665 // profiles. |last_used_profile| is the profile which owned the last open |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
782 // If we are showing the app list then chrome isn't shown so load the app | 808 // If we are showing the app list then chrome isn't shown so load the app |
783 // list's profile rather than chrome's. | 809 // list's profile rather than chrome's. |
784 if (command_line.HasSwitch(switches::kShowAppList)) { | 810 if (command_line.HasSwitch(switches::kShowAppList)) { |
785 return AppListService::Get(chrome::HOST_DESKTOP_TYPE_NATIVE)-> | 811 return AppListService::Get(chrome::HOST_DESKTOP_TYPE_NATIVE)-> |
786 GetProfilePath(user_data_dir); | 812 GetProfilePath(user_data_dir); |
787 } | 813 } |
788 | 814 |
789 return g_browser_process->profile_manager()->GetLastUsedProfileDir( | 815 return g_browser_process->profile_manager()->GetLastUsedProfileDir( |
790 user_data_dir); | 816 user_data_dir); |
791 } | 817 } |
OLD | NEW |