| 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 25 matching lines...) Expand all Loading... |
| 36 #include "chrome/common/result_codes.h" | 36 #include "chrome/common/result_codes.h" |
| 37 #include "chrome/common/url_constants.h" | 37 #include "chrome/common/url_constants.h" |
| 38 #include "grit/chromium_strings.h" | 38 #include "grit/chromium_strings.h" |
| 39 #include "grit/generated_resources.h" | 39 #include "grit/generated_resources.h" |
| 40 #include "grit/locale_settings.h" | 40 #include "grit/locale_settings.h" |
| 41 #include "grit/theme_resources.h" | 41 #include "grit/theme_resources.h" |
| 42 #include "net/http/http_network_layer.h" | 42 #include "net/http/http_network_layer.h" |
| 43 #include "net/base/net_util.h" | 43 #include "net/base/net_util.h" |
| 44 #include "webkit/glue/webkit_glue.h" | 44 #include "webkit/glue/webkit_glue.h" |
| 45 | 45 |
| 46 #if defined(OS_MACOSX) |
| 47 #include "chrome/browser/cocoa/keystone_infobar.h" |
| 48 #endif |
| 49 |
| 46 #if defined(OS_WIN) | 50 #if defined(OS_WIN) |
| 47 #include "app/win_util.h" | 51 #include "app/win_util.h" |
| 48 #endif | 52 #endif |
| 49 | 53 |
| 50 #if defined(OS_CHROMEOS) | 54 #if defined(OS_CHROMEOS) |
| 51 #include "chrome/browser/chromeos/gview_request_interceptor.h" | 55 #include "chrome/browser/chromeos/gview_request_interceptor.h" |
| 52 #include "chrome/browser/chromeos/mount_library.h" | 56 #include "chrome/browser/chromeos/mount_library.h" |
| 53 #include "chrome/browser/chromeos/usb_mount_observer.h" | 57 #include "chrome/browser/chromeos/usb_mount_observer.h" |
| 54 #include "chrome/browser/views/tabs/tab_overview_message_listener.h" | 58 #include "chrome/browser/views/tabs/tab_overview_message_listener.h" |
| 55 #endif | 59 #endif |
| (...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 443 // the home pages if no additional URLs were passed on the command line. | 447 // the home pages if no additional URLs were passed on the command line. |
| 444 if (!OpenStartupURLs(process_startup, urls_to_open)) { | 448 if (!OpenStartupURLs(process_startup, urls_to_open)) { |
| 445 // Add the home page and any special first run URLs. | 449 // Add the home page and any special first run URLs. |
| 446 Browser* browser = NULL; | 450 Browser* browser = NULL; |
| 447 if (urls_to_open.empty()) | 451 if (urls_to_open.empty()) |
| 448 AddStartupURLs(&urls_to_open); | 452 AddStartupURLs(&urls_to_open); |
| 449 else | 453 else |
| 450 browser = BrowserList::GetLastActive(); | 454 browser = BrowserList::GetLastActive(); |
| 451 OpenURLsInBrowser(browser, process_startup, urls_to_open); | 455 OpenURLsInBrowser(browser, process_startup, urls_to_open); |
| 452 } | 456 } |
| 453 // Check whether we are the default browser. | 457 if (process_startup) { |
| 454 if (process_startup && browser_defaults::kOSSupportsOtherBrowsers && | 458 if (browser_defaults::kOSSupportsOtherBrowsers && |
| 455 !command_line_.HasSwitch(switches::kNoDefaultBrowserCheck)) | 459 !command_line_.HasSwitch(switches::kNoDefaultBrowserCheck)) { |
| 456 CheckDefaultBrowser(profile); | 460 // Check whether we are the default browser. |
| 461 CheckDefaultBrowser(profile); |
| 462 } |
| 463 #if defined(OS_MACOSX) |
| 464 // Check whether the auto-update system needs to be promoted from user |
| 465 // to system. |
| 466 KeystoneInfoBar::PromotionInfoBar(profile); |
| 467 #endif |
| 468 } |
| 457 } else { | 469 } else { |
| 458 RecordLaunchModeHistogram(LM_AS_WEBAPP); | 470 RecordLaunchModeHistogram(LM_AS_WEBAPP); |
| 459 } | 471 } |
| 460 | 472 |
| 461 #if defined(OS_WIN) | 473 #if defined(OS_WIN) |
| 462 // Print the selected page if the command line switch exists. Note that the | 474 // Print the selected page if the command line switch exists. Note that the |
| 463 // current selected tab would be the page which will be printed. | 475 // current selected tab would be the page which will be printed. |
| 464 if (command_line_.HasSwitch(switches::kPrint)) { | 476 if (command_line_.HasSwitch(switches::kPrint)) { |
| 465 Browser* browser = BrowserList::GetLastActive(); | 477 Browser* browser = BrowserList::GetLastActive(); |
| 466 browser->Print(); | 478 browser->Print(); |
| (...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 848 scoped_refptr<AutomationProviderClass> automation = | 860 scoped_refptr<AutomationProviderClass> automation = |
| 849 new AutomationProviderClass(profile); | 861 new AutomationProviderClass(profile); |
| 850 automation->ConnectToChannel(channel_id); | 862 automation->ConnectToChannel(channel_id); |
| 851 automation->SetExpectedTabCount(expected_tabs); | 863 automation->SetExpectedTabCount(expected_tabs); |
| 852 | 864 |
| 853 AutomationProviderList* list = | 865 AutomationProviderList* list = |
| 854 g_browser_process->InitAutomationProviderList(); | 866 g_browser_process->InitAutomationProviderList(); |
| 855 DCHECK(list); | 867 DCHECK(list); |
| 856 list->AddProvider(automation); | 868 list->AddProvider(automation); |
| 857 } | 869 } |
| OLD | NEW |