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

Side by Side Diff: chrome/browser/ui/browser_init.cc

Issue 9117024: Changes to "launch with multiple profiles" behavior. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Code review. Created 8 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/chrome_browser_main.cc ('k') | 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/browser_init.h" 5 #include "chrome/browser/ui/browser_init.h"
6 6
7 #include <algorithm> // For max(). 7 #include <algorithm> // For max().
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 1685 matching lines...) Expand 10 before | Expand all | Expand 10 after
1696 CommandLine command_line_without_urls(command_line.GetProgram()); 1696 CommandLine command_line_without_urls(command_line.GetProgram());
1697 const CommandLine::SwitchMap& switches = command_line.GetSwitches(); 1697 const CommandLine::SwitchMap& switches = command_line.GetSwitches();
1698 for (CommandLine::SwitchMap::const_iterator switch_it = switches.begin(); 1698 for (CommandLine::SwitchMap::const_iterator switch_it = switches.begin();
1699 switch_it != switches.end(); ++switch_it) { 1699 switch_it != switches.end(); ++switch_it) {
1700 command_line_without_urls.AppendSwitchNative(switch_it->first, 1700 command_line_without_urls.AppendSwitchNative(switch_it->first,
1701 switch_it->second); 1701 switch_it->second);
1702 } 1702 }
1703 // Launch the profiles in the order they became active. 1703 // Launch the profiles in the order they became active.
1704 for (Profiles::const_iterator it = last_opened_profiles.begin(); 1704 for (Profiles::const_iterator it = last_opened_profiles.begin();
1705 it != last_opened_profiles.end(); ++it) { 1705 it != last_opened_profiles.end(); ++it) {
1706 // Don't launch additional profiles which would only open a new tab
1707 // page. When restarting after an update, all profiles will reopen last
1708 // open pages.
1709 SessionStartupPref startup_pref =
1710 GetSessionStartupPref(command_line, *it);
1711 if (*it != last_used_profile &&
1712 startup_pref.type != SessionStartupPref::LAST &&
1713 startup_pref.type != SessionStartupPref::URLS)
1714 continue;
1706 if (!browser_init->LaunchBrowser((*it == last_used_profile) ? 1715 if (!browser_init->LaunchBrowser((*it == last_used_profile) ?
1707 command_line : command_line_without_urls, *it, cur_dir, 1716 command_line : command_line_without_urls, *it, cur_dir,
1708 is_process_startup, is_first_run, return_code)) 1717 is_process_startup, is_first_run, return_code))
1709 return false; 1718 return false;
1710 // We've launched at least one browser. 1719 // We've launched at least one browser.
1711 is_process_startup = BrowserInit::IS_NOT_PROCESS_STARTUP; 1720 is_process_startup = BrowserInit::IS_NOT_PROCESS_STARTUP;
1712 } 1721 }
1713 } 1722 }
1714 } 1723 }
1715 return true; 1724 return true;
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
1759 1768
1760 Profile* profile = ProfileManager::GetLastUsedProfile(); 1769 Profile* profile = ProfileManager::GetLastUsedProfile();
1761 if (!profile) { 1770 if (!profile) {
1762 // We should only be able to get here if the profile already exists and 1771 // We should only be able to get here if the profile already exists and
1763 // has been created. 1772 // has been created.
1764 NOTREACHED(); 1773 NOTREACHED();
1765 return; 1774 return;
1766 } 1775 }
1767 ProcessCmdLineImpl(cmd_line, cur_dir, false, profile, Profiles(), NULL, NULL); 1776 ProcessCmdLineImpl(cmd_line, cur_dir, false, profile, Profiles(), NULL, NULL);
1768 } 1777 }
OLDNEW
« no previous file with comments | « chrome/browser/chrome_browser_main.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698