| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/browser_init.h" | 5 #include "chrome/browser/browser_init.h" |
| 6 | 6 |
| 7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "app/resource_bundle.h" | 8 #include "app/resource_bundle.h" |
| 9 #include "base/event_recorder.h" | 9 #include "base/event_recorder.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 431 std::vector<GURL> urls_to_open = GetURLsFromCommandLine(profile_); | 431 std::vector<GURL> urls_to_open = GetURLsFromCommandLine(profile_); |
| 432 RecordLaunchModeHistogram(urls_to_open.empty()? | 432 RecordLaunchModeHistogram(urls_to_open.empty()? |
| 433 LM_TO_BE_DECIDED : LM_WITH_URLS); | 433 LM_TO_BE_DECIDED : LM_WITH_URLS); |
| 434 // Always attempt to restore the last session. OpenStartupURLs only opens | 434 // Always attempt to restore the last session. OpenStartupURLs only opens |
| 435 // the home pages if no additional URLs were passed on the command line. | 435 // the home pages if no additional URLs were passed on the command line. |
| 436 if (!OpenStartupURLs(process_startup, urls_to_open)) { | 436 if (!OpenStartupURLs(process_startup, urls_to_open)) { |
| 437 // Add the home page and any special first run URLs. | 437 // Add the home page and any special first run URLs. |
| 438 Browser* browser = NULL; | 438 Browser* browser = NULL; |
| 439 if (urls_to_open.empty()) | 439 if (urls_to_open.empty()) |
| 440 AddStartupURLs(&urls_to_open); | 440 AddStartupURLs(&urls_to_open); |
| 441 else | 441 else if (!command_line_.HasSwitch(switches::kOpenInNewWindow)) |
| 442 browser = BrowserList::GetLastActive(); | 442 browser = BrowserList::GetLastActive(); |
| 443 |
| 443 OpenURLsInBrowser(browser, process_startup, urls_to_open); | 444 OpenURLsInBrowser(browser, process_startup, urls_to_open); |
| 444 } | 445 } |
| 445 if (process_startup) { | 446 if (process_startup) { |
| 446 if (browser_defaults::kOSSupportsOtherBrowsers && | 447 if (browser_defaults::kOSSupportsOtherBrowsers && |
| 447 !command_line_.HasSwitch(switches::kNoDefaultBrowserCheck)) { | 448 !command_line_.HasSwitch(switches::kNoDefaultBrowserCheck)) { |
| 448 // Check whether we are the default browser. | 449 // Check whether we are the default browser. |
| 449 CheckDefaultBrowser(profile); | 450 CheckDefaultBrowser(profile); |
| 450 } | 451 } |
| 451 #if defined(OS_MACOSX) | 452 #if defined(OS_MACOSX) |
| 452 // Check whether the auto-update system needs to be promoted from user | 453 // Check whether the auto-update system needs to be promoted from user |
| (...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 845 scoped_refptr<AutomationProviderClass> automation = | 846 scoped_refptr<AutomationProviderClass> automation = |
| 846 new AutomationProviderClass(profile); | 847 new AutomationProviderClass(profile); |
| 847 automation->ConnectToChannel(channel_id); | 848 automation->ConnectToChannel(channel_id); |
| 848 automation->SetExpectedTabCount(expected_tabs); | 849 automation->SetExpectedTabCount(expected_tabs); |
| 849 | 850 |
| 850 AutomationProviderList* list = | 851 AutomationProviderList* list = |
| 851 g_browser_process->InitAutomationProviderList(); | 852 g_browser_process->InitAutomationProviderList(); |
| 852 DCHECK(list); | 853 DCHECK(list); |
| 853 list->AddProvider(automation); | 854 list->AddProvider(automation); |
| 854 } | 855 } |
| OLD | NEW |