Index: chrome/browser/ui/startup/startup_browser_creator.cc |
diff --git a/chrome/browser/ui/startup/startup_browser_creator.cc b/chrome/browser/ui/startup/startup_browser_creator.cc |
index 381f26533567411023af064022ddddb521e9decb..7eebb2000c48aa122135a317b398d51dea2a1490 100644 |
--- a/chrome/browser/ui/startup/startup_browser_creator.cc |
+++ b/chrome/browser/ui/startup/startup_browser_creator.cc |
@@ -746,6 +746,19 @@ void StartupBrowserCreator::ProcessCommandLineAlreadyRunning( |
return; |
} |
+ // If the profile is loaded and the --activate-existing-profile-browser flag |
+ // is used, activate one of the profile's browser windows, if one exists. |
+ // Continuing to process the command line is not needed, since this will |
+ // end up opening a new browser window. |
+ if (command_line.HasSwitch(switches::kActivateExistingProfileBrowser)) { |
sky
2014/11/10 23:28:25
How do you know there isn't anything else interest
noms (inactive)
2014/11/12 19:04:11
This was originally in ProcessCmdLineImpl, but tap
|
+ Browser* browser = chrome::FindTabbedBrowser( |
+ profile, false, chrome::HOST_DESKTOP_TYPE_NATIVE); |
+ if (browser) { |
+ browser->window()->Activate(); |
+ return; |
+ } |
+ } |
+ |
ProcessCmdLineImpl(command_line, cur_dir, false, profile, Profiles(), NULL, |
NULL); |
} |