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

Side by Side Diff: chrome/browser/chrome_browser_main.cc

Issue 8550003: Defer construction of NotificationUIManager to fix notification initialization. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/chrome_browser_main.h" 5 #include "chrome/browser/chrome_browser_main.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 1834 matching lines...) Expand 10 before | Expand all | Expand 10 after
1845 1845
1846 run_message_loop_ = true; 1846 run_message_loop_ = true;
1847 return content::RESULT_CODE_NORMAL_EXIT; 1847 return content::RESULT_CODE_NORMAL_EXIT;
1848 } 1848 }
1849 1849
1850 // Called from MainMessageLoopRun(). 1850 // Called from MainMessageLoopRun().
1851 void ChromeBrowserMainParts::StartBrowserOrUITask() { 1851 void ChromeBrowserMainParts::StartBrowserOrUITask() {
1852 // Still initializing, so need to allow IO. 1852 // Still initializing, so need to allow IO.
1853 base::ThreadRestrictions::ScopedAllowIO allow_io; 1853 base::ThreadRestrictions::ScopedAllowIO allow_io;
1854 1854
1855 // Set the notification UI manager after any desktop initialization in
1856 // PreMainMessageLoopRun() is complete, and before starting the browser.
1857 DesktopNotificationServiceFactory::GetForProfile(profile_)->SetUIManager(
1858 g_browser_process->notification_ui_manager());
1859
1860 // Tests should be able to tune login manager before showing it. 1855 // Tests should be able to tune login manager before showing it.
1861 // Thus only show login manager in normal (non-testing) mode. 1856 // Thus only show login manager in normal (non-testing) mode.
1862 if (!parameters().ui_task) 1857 if (!parameters().ui_task)
1863 OptionallyRunChromeOSLoginManager(parsed_command_line(), profile_); 1858 OptionallyRunChromeOSLoginManager(parsed_command_line(), profile_);
1864 1859
1865 if (parameters().ui_task) { 1860 if (parameters().ui_task) {
1866 // We are in test mode. Run one task and enter the main message loop. 1861 // We are in test mode. Run one task and enter the main message loop.
1867 #if defined(OS_MACOSX) 1862 #if defined(OS_MACOSX)
1868 if (parameters().autorelease_pool) 1863 if (parameters().autorelease_pool)
1869 parameters().autorelease_pool->Recycle(); 1864 parameters().autorelease_pool->Recycle();
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
2086 if (env->GetVar(chrome::kPreReadEnvironmentVariable, &pre_read) && 2081 if (env->GetVar(chrome::kPreReadEnvironmentVariable, &pre_read) &&
2087 (pre_read == "0" || pre_read == "1")) { 2082 (pre_read == "0" || pre_read == "1")) {
2088 std::string uma_name(name); 2083 std::string uma_name(name);
2089 uma_name += "_PreRead"; 2084 uma_name += "_PreRead";
2090 uma_name += pre_read == "1" ? "Enabled" : "Disabled"; 2085 uma_name += pre_read == "1" ? "Enabled" : "Disabled";
2091 AddPreReadHistogramTime(uma_name.c_str(), time); 2086 AddPreReadHistogramTime(uma_name.c_str(), time);
2092 } 2087 }
2093 #endif 2088 #endif
2094 #endif 2089 #endif
2095 } 2090 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698