| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 #include "chrome/browser/after_startup_task_utils.h" | 43 #include "chrome/browser/after_startup_task_utils.h" |
| 44 #include "chrome/browser/browser_process.h" | 44 #include "chrome/browser/browser_process.h" |
| 45 #include "chrome/browser/browser_process_impl.h" | 45 #include "chrome/browser/browser_process_impl.h" |
| 46 #include "chrome/browser/browser_process_platform_part.h" | 46 #include "chrome/browser/browser_process_platform_part.h" |
| 47 #include "chrome/browser/browser_shutdown.h" | 47 #include "chrome/browser/browser_shutdown.h" |
| 48 #include "chrome/browser/chrome_browser_main_extra_parts.h" | 48 #include "chrome/browser/chrome_browser_main_extra_parts.h" |
| 49 #include "chrome/browser/component_updater/cld_component_installer.h" | 49 #include "chrome/browser/component_updater/cld_component_installer.h" |
| 50 #include "chrome/browser/component_updater/ev_whitelist_component_installer.h" | 50 #include "chrome/browser/component_updater/ev_whitelist_component_installer.h" |
| 51 #include "chrome/browser/component_updater/flash_component_installer.h" | 51 #include "chrome/browser/component_updater/flash_component_installer.h" |
| 52 #include "chrome/browser/component_updater/recovery_component_installer.h" | 52 #include "chrome/browser/component_updater/recovery_component_installer.h" |
| 53 #include "chrome/browser/component_updater/sth_set_component_installer.h" |
| 53 #include "chrome/browser/component_updater/supervised_user_whitelist_installer.h
" | 54 #include "chrome/browser/component_updater/supervised_user_whitelist_installer.h
" |
| 54 #include "chrome/browser/component_updater/swiftshader_component_installer.h" | 55 #include "chrome/browser/component_updater/swiftshader_component_installer.h" |
| 55 #include "chrome/browser/component_updater/widevine_cdm_component_installer.h" | 56 #include "chrome/browser/component_updater/widevine_cdm_component_installer.h" |
| 56 #include "chrome/browser/defaults.h" | 57 #include "chrome/browser/defaults.h" |
| 57 #include "chrome/browser/first_run/first_run.h" | 58 #include "chrome/browser/first_run/first_run.h" |
| 58 #include "chrome/browser/gpu/gl_string_manager.h" | 59 #include "chrome/browser/gpu/gl_string_manager.h" |
| 59 #include "chrome/browser/gpu/three_d_api_observer.h" | 60 #include "chrome/browser/gpu/three_d_api_observer.h" |
| 60 #include "chrome/browser/media/media_capture_devices_dispatcher.h" | 61 #include "chrome/browser/media/media_capture_devices_dispatcher.h" |
| 61 #include "chrome/browser/memory/tab_manager.h" | 62 #include "chrome/browser/memory/tab_manager.h" |
| 62 #include "chrome/browser/metrics/field_trial_synchronizer.h" | 63 #include "chrome/browser/metrics/field_trial_synchronizer.h" |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 #include "content/public/browser/notification_types.h" | 144 #include "content/public/browser/notification_types.h" |
| 144 #include "content/public/browser/power_usage_monitor.h" | 145 #include "content/public/browser/power_usage_monitor.h" |
| 145 #include "content/public/browser/site_instance.h" | 146 #include "content/public/browser/site_instance.h" |
| 146 #include "content/public/common/content_client.h" | 147 #include "content/public/common/content_client.h" |
| 147 #include "content/public/common/content_features.h" | 148 #include "content/public/common/content_features.h" |
| 148 #include "content/public/common/content_switches.h" | 149 #include "content/public/common/content_switches.h" |
| 149 #include "content/public/common/main_function_params.h" | 150 #include "content/public/common/main_function_params.h" |
| 150 #include "grit/platform_locale_settings.h" | 151 #include "grit/platform_locale_settings.h" |
| 151 #include "media/base/media_resources.h" | 152 #include "media/base/media_resources.h" |
| 152 #include "net/base/net_module.h" | 153 #include "net/base/net_module.h" |
| 154 #include "net/cert/sth_distributor.h" |
| 153 #include "net/cookies/cookie_monster.h" | 155 #include "net/cookies/cookie_monster.h" |
| 154 #include "net/http/http_network_layer.h" | 156 #include "net/http/http_network_layer.h" |
| 155 #include "net/http/http_stream_factory.h" | 157 #include "net/http/http_stream_factory.h" |
| 156 #include "net/url_request/url_request.h" | 158 #include "net/url_request/url_request.h" |
| 157 #include "ui/base/l10n/l10n_util.h" | 159 #include "ui/base/l10n/l10n_util.h" |
| 158 #include "ui/base/layout.h" | 160 #include "ui/base/layout.h" |
| 159 #include "ui/base/resource/resource_bundle.h" | 161 #include "ui/base/resource/resource_bundle.h" |
| 160 #include "ui/strings/grit/app_locale_settings.h" | 162 #include "ui/strings/grit/app_locale_settings.h" |
| 161 | 163 |
| 162 #if BUILDFLAG(ANDROID_JAVA_UI) | 164 #if BUILDFLAG(ANDROID_JAVA_UI) |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 434 return NULL; | 436 return NULL; |
| 435 } | 437 } |
| 436 | 438 |
| 437 #if defined(OS_MACOSX) | 439 #if defined(OS_MACOSX) |
| 438 OSStatus KeychainCallback(SecKeychainEvent keychain_event, | 440 OSStatus KeychainCallback(SecKeychainEvent keychain_event, |
| 439 SecKeychainCallbackInfo* info, void* context) { | 441 SecKeychainCallbackInfo* info, void* context) { |
| 440 return noErr; | 442 return noErr; |
| 441 } | 443 } |
| 442 #endif // defined(OS_MACOSX) | 444 #endif // defined(OS_MACOSX) |
| 443 | 445 |
| 444 void RegisterComponentsForUpdate() { | 446 void RegisterComponentsForUpdate( |
| 447 scoped_ptr<net::ct::STHDistributor> sth_distributor) { |
| 445 component_updater::ComponentUpdateService* cus = | 448 component_updater::ComponentUpdateService* cus = |
| 446 g_browser_process->component_updater(); | 449 g_browser_process->component_updater(); |
| 447 | 450 |
| 448 // Registration can be before or after cus->Start() so it is ok to post | 451 // Registration can be before or after cus->Start() so it is ok to post |
| 449 // a task to the UI thread to do registration once you done the necessary | 452 // a task to the UI thread to do registration once you done the necessary |
| 450 // file IO to know you existing component version. | 453 // file IO to know you existing component version. |
| 451 #if !defined(OS_CHROMEOS) && !defined(OS_ANDROID) | 454 #if !defined(OS_CHROMEOS) && !defined(OS_ANDROID) |
| 452 RegisterRecoveryComponent(cus, g_browser_process->local_state()); | 455 RegisterRecoveryComponent(cus, g_browser_process->local_state()); |
| 453 RegisterPepperFlashComponent(cus); | 456 RegisterPepperFlashComponent(cus); |
| 454 RegisterSwiftShaderComponent(cus); | 457 RegisterSwiftShaderComponent(cus); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 481 g_browser_process->crl_set_fetcher()->DeleteFromDisk(path); | 484 g_browser_process->crl_set_fetcher()->DeleteFromDisk(path); |
| 482 #elif !defined(OS_CHROMEOS) | 485 #elif !defined(OS_CHROMEOS) |
| 483 // CRLSetFetcher attempts to load a CRL set from either the local disk or | 486 // CRLSetFetcher attempts to load a CRL set from either the local disk or |
| 484 // network. | 487 // network. |
| 485 // For Chrome OS this registration is delayed until user login. | 488 // For Chrome OS this registration is delayed until user login. |
| 486 g_browser_process->crl_set_fetcher()->StartInitialLoad(cus, path); | 489 g_browser_process->crl_set_fetcher()->StartInitialLoad(cus, path); |
| 487 // Registration of the EV Whitelist component here is not necessary for: | 490 // Registration of the EV Whitelist component here is not necessary for: |
| 488 // 1. Android: Because it currently does not have the EV indicator. | 491 // 1. Android: Because it currently does not have the EV indicator. |
| 489 // 2. Chrome OS: On Chrome OS this registration is delayed until user login. | 492 // 2. Chrome OS: On Chrome OS this registration is delayed until user login. |
| 490 RegisterEVWhitelistComponent(cus, path); | 493 RegisterEVWhitelistComponent(cus, path); |
| 494 |
| 495 // Registration of the STH set fetcher here is not done for: |
| 496 // Android: Because the story around CT on Mobile is not finalized yet. |
| 497 // Chrome OS: On Chrome OS this registration is delayed until user login. |
| 498 RegisterSTHSetComponent(cus, path, std::move(sth_distributor)); |
| 491 #endif // defined(OS_ANDROID) | 499 #endif // defined(OS_ANDROID) |
| 492 } | 500 } |
| 493 | 501 |
| 494 #if defined(OS_WIN) | 502 #if defined(OS_WIN) |
| 495 #if defined(GOOGLE_CHROME_BUILD) | 503 #if defined(GOOGLE_CHROME_BUILD) |
| 496 RegisterSwReporterComponent(cus); | 504 RegisterSwReporterComponent(cus); |
| 497 #endif // defined(GOOGLE_CHROME_BUILD) | 505 #endif // defined(GOOGLE_CHROME_BUILD) |
| 498 RegisterCAPSComponent(cus); | 506 RegisterCAPSComponent(cus); |
| 499 #endif // defined(OS_WIN) | 507 #endif // defined(OS_WIN) |
| 500 } | 508 } |
| (...skipping 1193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1694 // Instantiate the notification UI manager, as this triggers a perf timer | 1702 // Instantiate the notification UI manager, as this triggers a perf timer |
| 1695 // used to measure startup time. TODO(stevenjb): Figure out what is actually | 1703 // used to measure startup time. TODO(stevenjb): Figure out what is actually |
| 1696 // triggering the timer and call that explicitly in the approprate place. | 1704 // triggering the timer and call that explicitly in the approprate place. |
| 1697 // http://crbug.com/105065. | 1705 // http://crbug.com/105065. |
| 1698 browser_process_->notification_ui_manager(); | 1706 browser_process_->notification_ui_manager(); |
| 1699 | 1707 |
| 1700 // This must be called prior to RegisterComponentsForUpdate, in case the CLD | 1708 // This must be called prior to RegisterComponentsForUpdate, in case the CLD |
| 1701 // data source is based on the Component Updater. | 1709 // data source is based on the Component Updater. |
| 1702 translate::BrowserCldUtils::ConfigureDefaultDataProvider(); | 1710 translate::BrowserCldUtils::ConfigureDefaultDataProvider(); |
| 1703 | 1711 |
| 1704 if (!parsed_command_line().HasSwitch(switches::kDisableComponentUpdate)) | 1712 if (!parsed_command_line().HasSwitch(switches::kDisableComponentUpdate)) { |
| 1705 RegisterComponentsForUpdate(); | 1713 scoped_ptr<net::ct::STHDistributor> distributor( |
| 1714 new net::ct::STHDistributor()); |
| 1715 browser_process_->RegisterWithSTHObserver(distributor.get()); |
| 1716 RegisterComponentsForUpdate(std::move(distributor)); |
| 1717 } |
| 1706 | 1718 |
| 1707 #if defined(OS_ANDROID) | 1719 #if defined(OS_ANDROID) |
| 1708 variations::VariationsService* variations_service = | 1720 variations::VariationsService* variations_service = |
| 1709 browser_process_->variations_service(); | 1721 browser_process_->variations_service(); |
| 1710 if (variations_service) { | 1722 if (variations_service) { |
| 1711 // Just initialize the policy prefs service here. Variations seed fetching | 1723 // Just initialize the policy prefs service here. Variations seed fetching |
| 1712 // will be initialized when the app enters foreground mode. | 1724 // will be initialized when the app enters foreground mode. |
| 1713 variations_service->set_policy_pref_service(profile_->GetPrefs()); | 1725 variations_service->set_policy_pref_service(profile_->GetPrefs()); |
| 1714 } | 1726 } |
| 1715 translate::TranslateDownloadManager::RequestLanguageList( | 1727 translate::TranslateDownloadManager::RequestLanguageList( |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1942 chromeos::CrosSettings::Shutdown(); | 1954 chromeos::CrosSettings::Shutdown(); |
| 1943 #endif // defined(OS_CHROMEOS) | 1955 #endif // defined(OS_CHROMEOS) |
| 1944 #endif // defined(OS_ANDROID) | 1956 #endif // defined(OS_ANDROID) |
| 1945 } | 1957 } |
| 1946 | 1958 |
| 1947 // Public members: | 1959 // Public members: |
| 1948 | 1960 |
| 1949 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { | 1961 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { |
| 1950 chrome_extra_parts_.push_back(parts); | 1962 chrome_extra_parts_.push_back(parts); |
| 1951 } | 1963 } |
| OLD | NEW |