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

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: 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
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..df45a6ba98937576f9f8a0b50e3332b0c3046a94 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::ProcessCommandLinePostStartup(parsed_command_line, cur_dir);
return TRUE;
}
return TRUE;

Powered by Google App Engine
This is Rietveld 408576698