Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(318)

Side by Side Diff: chrome/browser/ui/startup/startup_browser_creator.cc

Issue 893383002: Never launch a new window when --no-startup-window is specified. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: bracket fix Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698