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

Unified Diff: chrome/browser/process_singleton_win.cc

Issue 8854001: Honor profile directory when creating new window in existing browser (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address review comments Created 9 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/process_singleton_linux.cc ('k') | chrome/browser/ui/browser_init.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/process_singleton_win.cc
diff --git a/chrome/browser/process_singleton_win.cc b/chrome/browser/process_singleton_win.cc
index 52d43b7ce1bc8c04b321f24f2c5bca0dbb715dee..e92a5f2cbe655dd85f82fbeacc2b88a26724ed03 100644
--- a/chrome/browser/process_singleton_win.cc
+++ b/chrome/browser/process_singleton_win.cc
@@ -311,18 +311,22 @@ LRESULT ProcessSingleton::OnCopyData(HWND hwnd, const COPYDATASTRUCT* cds) {
PrefService* prefs = g_browser_process->local_state();
DCHECK(prefs);
- Profile* profile = ProfileManager::GetLastUsedProfile();
- if (!profile) {
- // We should only be able to get here if the profile already exists and
- // has been created.
- NOTREACHED();
- return TRUE;
- }
-
// Handle the --uninstall-extension startup action. This needs to done here
// in the process that is running with the target profile, otherwise the
// uninstall will fail to unload and remove all components.
if (parsed_command_line.HasSwitch(switches::kUninstallExtension)) {
+ // The uninstall extension switch can't be combined with the profile
+ // directory switch.
+ DCHECK(!parsed_command_line.HasSwitch(switches::kProfileDirectory));
+
+ Profile* profile = ProfileManager::GetLastUsedProfile();
+ if (!profile) {
+ // We should only be able to get here if the profile already exists and
+ // has been created.
+ NOTREACHED();
+ return TRUE;
+ }
+
ExtensionsStartupUtil ext_startup_util;
ext_startup_util.UninstallExtension(parsed_command_line, profile);
return TRUE;
@@ -330,8 +334,7 @@ LRESULT ProcessSingleton::OnCopyData(HWND hwnd, const COPYDATASTRUCT* cds) {
// Run the browser startup sequence again, with the command line of the
// signalling process.
- BrowserInit::ProcessCommandLine(parsed_command_line, cur_dir, false,
- profile, NULL);
+ BrowserInit::ProcessCommandLineAlreadyRunning(parsed_command_line, cur_dir);
return TRUE;
}
return TRUE;
« no previous file with comments | « chrome/browser/process_singleton_linux.cc ('k') | chrome/browser/ui/browser_init.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698