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 582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
593 base::FilePath output_file( | 593 base::FilePath output_file( |
594 command_line.GetSwitchValuePath(switches::kDumpBrowserHistograms)); | 594 command_line.GetSwitchValuePath(switches::kDumpBrowserHistograms)); |
595 if (!output_file.empty()) { | 595 if (!output_file.empty()) { |
596 BrowserThread::PostBlockingPoolTask( | 596 BrowserThread::PostBlockingPoolTask( |
597 FROM_HERE, | 597 FROM_HERE, |
598 base::Bind(&DumpBrowserHistograms, output_file)); | 598 base::Bind(&DumpBrowserHistograms, output_file)); |
599 } | 599 } |
600 silent_launch = true; | 600 silent_launch = true; |
601 } | 601 } |
602 | 602 |
| 603 // If --no-startup-window is specified and Chrome is already running then do |
| 604 // not open a new window. |
| 605 if (!process_startup && command_line.HasSwitch(switches::kNoStartupWindow)) |
| 606 silent_launch = true; |
| 607 |
603 // If we don't want to launch a new browser window or tab we are done here. | 608 // If we don't want to launch a new browser window or tab we are done here. |
604 if (silent_launch) | 609 if (silent_launch) |
605 return true; | 610 return true; |
606 | 611 |
607 VLOG(2) << "ProcessCmdLineImpl: PLACE 4.A"; | 612 VLOG(2) << "ProcessCmdLineImpl: PLACE 4.A"; |
608 if (command_line.HasSwitch(extensions::switches::kLoadApps) && | 613 if (command_line.HasSwitch(extensions::switches::kLoadApps) && |
609 !IncognitoModePrefs::ShouldLaunchIncognito( | 614 !IncognitoModePrefs::ShouldLaunchIncognito( |
610 command_line, last_used_profile->GetPrefs())) { | 615 command_line, last_used_profile->GetPrefs())) { |
611 if (!ProcessLoadApps(command_line, cur_dir, last_used_profile)) | 616 if (!ProcessLoadApps(command_line, cur_dir, last_used_profile)) |
612 return false; | 617 return false; |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
856 // If we are showing the app list then chrome isn't shown so load the app | 861 // If we are showing the app list then chrome isn't shown so load the app |
857 // list's profile rather than chrome's. | 862 // list's profile rather than chrome's. |
858 if (command_line.HasSwitch(switches::kShowAppList)) { | 863 if (command_line.HasSwitch(switches::kShowAppList)) { |
859 return AppListService::Get(chrome::HOST_DESKTOP_TYPE_NATIVE)-> | 864 return AppListService::Get(chrome::HOST_DESKTOP_TYPE_NATIVE)-> |
860 GetProfilePath(user_data_dir); | 865 GetProfilePath(user_data_dir); |
861 } | 866 } |
862 | 867 |
863 return g_browser_process->profile_manager()->GetLastUsedProfileDir( | 868 return g_browser_process->profile_manager()->GetLastUsedProfileDir( |
864 user_data_dir); | 869 user_data_dir); |
865 } | 870 } |
OLD | NEW |