Index: chrome/browser/chrome_browser_main.cc |
diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc |
index 87fb3eed7c783f80602549dc277c5286790a73ac..b4388491ee12da35a19eb2fb118705bf6a26d267 100644 |
--- a/chrome/browser/chrome_browser_main.cc |
+++ b/chrome/browser/chrome_browser_main.cc |
@@ -1515,13 +1515,20 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { |
return chrome::RESULT_CODE_PACK_EXTENSION_ERROR; |
} |
+ bool pass_command_line = |
Paweł Hajdan Jr.
2012/06/23 07:23:37
This #ifdef-mixed assignment is ugly. Please find
|
#if !defined(OS_MACOSX) |
Albert Bodenhamer
2012/06/27 16:35:33
This is a bit hard to parse. perhaps something li
|
// In environments other than Mac OS X we support import of settings |
// from other browsers. In case this process is a short-lived "import" |
// process that another browser runs just to import the settings, we |
// don't want to be checking for another browser process, by design. |
- if (!HasImportSwitch(parsed_command_line())) { |
+ !HasImportSwitch(parsed_command_line()) && |
#endif |
+ // If we're being launched just to check the connector policy, we are |
+ // short-lived and don't want to be passing that switch off. |
+ !parsed_command_line().HasSwitch( |
+ switches::kCheckCloudPrintConnectorPolicy); |
+ |
+ if (pass_command_line) { |
// When another process is running, use that process instead of starting a |
// new one. NotifyOtherProcess will currently give the other process up to |
// 20 seconds to respond. Note that this needs to be done before we attempt |
@@ -1554,9 +1561,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { |
default: |
NOTREACHED(); |
} |
-#if !defined(OS_MACOSX) // closing brace for if |
} |
-#endif |
#if defined(USE_X11) |
SetBrowserX11ErrorHandlers(); |
@@ -1966,7 +1971,8 @@ void ChromeBrowserMainParts::PostMainMessageLoopRun() { |
// Stop all tasks that might run on WatchDogThread. |
ThreadWatcherList::StopWatchingAll(); |
- browser_process_->metrics_service()->Stop(); |
+ if (browser_process_->metrics_service()) |
+ browser_process_->metrics_service()->Stop(); |
restart_last_session_ = browser_shutdown::ShutdownPreThreadsStop(); |
browser_process_->StartTearDown(); |