summaryrefslogtreecommitdiffstats
path: root/chrome/browser/browser_main.cc
diff options
context:
space:
mode:
authorcpu@google.com <cpu@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-07 23:37:59 +0000
committercpu@google.com <cpu@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-07 23:37:59 +0000
commit4a8bca5ce3b7c77514f3a46625c0ac397848b15b (patch)
tree5b460d39ca15419f076d8cd697223ebdcbaa8574 /chrome/browser/browser_main.cc
parent7c0bef11a5930ee52e6351248228444889bdc702 (diff)
downloadchromium_src-4a8bca5ce3b7c77514f3a46625c0ac397848b15b.zip
chromium_src-4a8bca5ce3b7c77514f3a46625c0ac397848b15b.tar.gz
chromium_src-4a8bca5ce3b7c77514f3a46625c0ac397848b15b.tar.bz2
Refactor BrowserInit in preparation for customized first run tabs
- BrowserInit is now a instanciable class - The 'bag of static functions' part is mostly unchanged - unused members in the interface moved to the cc file TEST= no visible change. interactive UI tests sufice BUG=9706 Review URL: http://codereview.chromium.org/113113 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15595 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser_main.cc')
-rw-r--r--chrome/browser/browser_main.cc29
1 files changed, 16 insertions, 13 deletions
diff --git a/chrome/browser/browser_main.cc b/chrome/browser/browser_main.cc
index 9b675f1..79e6378 100644
--- a/chrome/browser/browser_main.cc
+++ b/chrome/browser/browser_main.cc
@@ -445,6 +445,7 @@ int BrowserMain(const MainFunctionParams& parameters) {
return ResultCodes::MACHINE_LEVEL_INSTALL_EXISTS;
process_singleton.Create();
+ BrowserInit browser_init;
// Show the First Run UI if this is the first time Chrome has been run on
// this computer, or we're being compelled to do so by a command line flag.
@@ -604,26 +605,28 @@ int BrowserMain(const MainFunctionParams& parameters) {
#endif
HandleErrorTestParameters(parsed_command_line);
-
RecordBreakpadStatusUMA(metrics);
-
- // Start up the extensions service.
- // This should happen before ProcessCommandLine.
+ // Start up the extensions service. This should happen before Start().
profile->InitExtensions();
- // Call Recycle() here as late as possible, just before going into the main
- // loop. We can't do it any earlier, as ProcessCommandLine() will add things
- // to it in the act of creating the initial browser window.
int result_code = ResultCodes::NORMAL_EXIT;
if (parameters.ui_task) {
- if (pool) pool->Recycle();
+ // We are in test mode. Run one task and enter the main message loop.
+ if (pool)
+ pool->Recycle();
MessageLoopForUI::current()->PostTask(FROM_HERE, parameters.ui_task);
RunUIMessageLoop(browser_process.get());
- } else if (BrowserInit::ProcessCommandLine(parsed_command_line,
- std::wstring(), true, profile,
- &result_code)) {
- if (pool) pool->Recycle();
- RunUIMessageLoop(browser_process.get());
+ } else {
+ // We are in regular browser boot sequence. Open initial stabs and enter
+ // the main message loop.
+ if (browser_init.Start(parsed_command_line, std::wstring(), profile,
+ &result_code)) {
+ // Call Recycle() here as late as possible, before going into the loop
+ // because Start() will add things to it while creating the main window.
+ if (pool)
+ pool->Recycle();
+ RunUIMessageLoop(browser_process.get());
+ }
}
Platform::WillTerminate();