| 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 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 432 std::vector<GURL> urls_to_open = GetURLsFromCommandLine(profile_); | 432 std::vector<GURL> urls_to_open = GetURLsFromCommandLine(profile_); |
| 433 RecordLaunchModeHistogram(urls_to_open.empty()? | 433 RecordLaunchModeHistogram(urls_to_open.empty()? |
| 434 LM_TO_BE_DECIDED : LM_WITH_URLS); | 434 LM_TO_BE_DECIDED : LM_WITH_URLS); |
| 435 // Always attempt to restore the last session. OpenStartupURLs only opens | 435 // Always attempt to restore the last session. OpenStartupURLs only opens |
| 436 // the home pages if no additional URLs were passed on the command line. | 436 // the home pages if no additional URLs were passed on the command line. |
| 437 if (!OpenStartupURLs(process_startup, urls_to_open)) { | 437 if (!OpenStartupURLs(process_startup, urls_to_open)) { |
| 438 // Add the home page and any special first run URLs. | 438 // Add the home page and any special first run URLs. |
| 439 Browser* browser = NULL; | 439 Browser* browser = NULL; |
| 440 if (urls_to_open.empty()) | 440 if (urls_to_open.empty()) |
| 441 AddStartupURLs(&urls_to_open); | 441 AddStartupURLs(&urls_to_open); |
| 442 else | 442 else if (!command_line_.HasSwitch(switches::kOpenInNewWindow)) |
| 443 browser = BrowserList::GetLastActive(); | 443 browser = BrowserList::GetLastActive(); |
| 444 |
| 444 OpenURLsInBrowser(browser, process_startup, urls_to_open); | 445 OpenURLsInBrowser(browser, process_startup, urls_to_open); |
| 445 } | 446 } |
| 446 if (process_startup) { | 447 if (process_startup) { |
| 447 if (browser_defaults::kOSSupportsOtherBrowsers && | 448 if (browser_defaults::kOSSupportsOtherBrowsers && |
| 448 !command_line_.HasSwitch(switches::kNoDefaultBrowserCheck)) { | 449 !command_line_.HasSwitch(switches::kNoDefaultBrowserCheck)) { |
| 449 // Check whether we are the default browser. | 450 // Check whether we are the default browser. |
| 450 CheckDefaultBrowser(profile); | 451 CheckDefaultBrowser(profile); |
| 451 } | 452 } |
| 452 #if defined(OS_MACOSX) | 453 #if defined(OS_MACOSX) |
| 453 // Check whether the auto-update system needs to be promoted from user | 454 // Check whether the auto-update system needs to be promoted from user |
| (...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 852 scoped_refptr<AutomationProviderClass> automation = | 853 scoped_refptr<AutomationProviderClass> automation = |
| 853 new AutomationProviderClass(profile); | 854 new AutomationProviderClass(profile); |
| 854 automation->ConnectToChannel(channel_id); | 855 automation->ConnectToChannel(channel_id); |
| 855 automation->SetExpectedTabCount(expected_tabs); | 856 automation->SetExpectedTabCount(expected_tabs); |
| 856 | 857 |
| 857 AutomationProviderList* list = | 858 AutomationProviderList* list = |
| 858 g_browser_process->InitAutomationProviderList(); | 859 g_browser_process->InitAutomationProviderList(); |
| 859 DCHECK(list); | 860 DCHECK(list); |
| 860 list->AddProvider(automation); | 861 list->AddProvider(automation); |
| 861 } | 862 } |
| OLD | NEW |