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 <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 #include "chrome/installer/util/google_update_settings.h" | 103 #include "chrome/installer/util/google_update_settings.h" |
104 #include "components/component_updater/component_updater_service.h" | 104 #include "components/component_updater/component_updater_service.h" |
105 #include "components/google/core/browser/google_util.h" | 105 #include "components/google/core/browser/google_util.h" |
106 #include "components/language_usage_metrics/language_usage_metrics.h" | 106 #include "components/language_usage_metrics/language_usage_metrics.h" |
107 #include "components/metrics/metrics_service.h" | 107 #include "components/metrics/metrics_service.h" |
108 #include "components/metrics/profiler/tracking_synchronizer.h" | 108 #include "components/metrics/profiler/tracking_synchronizer.h" |
109 #include "components/nacl/browser/nacl_browser.h" | 109 #include "components/nacl/browser/nacl_browser.h" |
110 #include "components/rappor/rappor_service.h" | 110 #include "components/rappor/rappor_service.h" |
111 #include "components/signin/core/common/profile_management_switches.h" | 111 #include "components/signin/core/common/profile_management_switches.h" |
112 #include "components/startup_metric_utils/startup_metric_utils.h" | 112 #include "components/startup_metric_utils/startup_metric_utils.h" |
| 113 #include "components/translate/content/browser/browser_cld_utils.h" |
113 #include "components/translate/content/common/cld_data_source.h" | 114 #include "components/translate/content/common/cld_data_source.h" |
114 #include "components/translate/core/browser/translate_download_manager.h" | 115 #include "components/translate/core/browser/translate_download_manager.h" |
115 #include "components/variations/net/variations_http_header_provider.h" | 116 #include "components/variations/net/variations_http_header_provider.h" |
116 #include "content/public/browser/browser_thread.h" | 117 #include "content/public/browser/browser_thread.h" |
117 #include "content/public/browser/notification_observer.h" | 118 #include "content/public/browser/notification_observer.h" |
118 #include "content/public/browser/notification_registrar.h" | 119 #include "content/public/browser/notification_registrar.h" |
119 #include "content/public/browser/notification_service.h" | 120 #include "content/public/browser/notification_service.h" |
120 #include "content/public/browser/notification_types.h" | 121 #include "content/public/browser/notification_types.h" |
121 #include "content/public/browser/site_instance.h" | 122 #include "content/public/browser/site_instance.h" |
122 #include "content/public/common/content_client.h" | 123 #include "content/public/common/content_client.h" |
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 #if !defined(DISABLE_NACL) && !defined(OS_ANDROID) | 415 #if !defined(DISABLE_NACL) && !defined(OS_ANDROID) |
415 #if defined(OS_CHROMEOS) | 416 #if defined(OS_CHROMEOS) |
416 // PNaCl on Chrome OS is on rootfs and there is no need to download it. But | 417 // PNaCl on Chrome OS is on rootfs and there is no need to download it. But |
417 // Chrome4ChromeOS on Linux doesn't contain PNaCl so enable component | 418 // Chrome4ChromeOS on Linux doesn't contain PNaCl so enable component |
418 // installer when ruining on Linux. See crbug.com/422121 for more details. | 419 // installer when ruining on Linux. See crbug.com/422121 for more details. |
419 if (!base::SysInfo::IsRunningOnChromeOS()) | 420 if (!base::SysInfo::IsRunningOnChromeOS()) |
420 #endif | 421 #endif |
421 g_browser_process->pnacl_component_installer()->RegisterPnaclComponent(cus); | 422 g_browser_process->pnacl_component_installer()->RegisterPnaclComponent(cus); |
422 #endif | 423 #endif |
423 | 424 |
424 if (translate::CldDataSource::ShouldRegisterForComponentUpdates()) { | 425 // Registration of the CLD Component is a no-op unless the CLD data source has |
425 RegisterCldComponent(cus); | 426 // been configured to be the "Component" data source. |
426 } | 427 RegisterCldComponent(cus); |
427 | 428 |
428 base::FilePath path; | 429 base::FilePath path; |
429 if (PathService::Get(chrome::DIR_USER_DATA, &path)) { | 430 if (PathService::Get(chrome::DIR_USER_DATA, &path)) { |
430 #if defined(OS_ANDROID) | 431 #if defined(OS_ANDROID) |
431 // The CRLSet component was enabled for some releases. This code attempts to | 432 // The CRLSet component was enabled for some releases. This code attempts to |
432 // delete it from the local disk of those how may have downloaded it. | 433 // delete it from the local disk of those how may have downloaded it. |
433 g_browser_process->crl_set_fetcher()->DeleteFromDisk(path); | 434 g_browser_process->crl_set_fetcher()->DeleteFromDisk(path); |
434 #elif !defined(OS_CHROMEOS) | 435 #elif !defined(OS_CHROMEOS) |
435 // CRLSetFetcher attempts to load a CRL set from either the local disk or | 436 // CRLSetFetcher attempts to load a CRL set from either the local disk or |
436 // network. | 437 // network. |
(...skipping 1058 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1495 PrefMetricsService::Factory::GetForProfile(profile_); | 1496 PrefMetricsService::Factory::GetForProfile(profile_); |
1496 | 1497 |
1497 PreBrowserStart(); | 1498 PreBrowserStart(); |
1498 | 1499 |
1499 // Instantiate the notification UI manager, as this triggers a perf timer | 1500 // Instantiate the notification UI manager, as this triggers a perf timer |
1500 // used to measure startup time. TODO(stevenjb): Figure out what is actually | 1501 // used to measure startup time. TODO(stevenjb): Figure out what is actually |
1501 // triggering the timer and call that explicitly in the approprate place. | 1502 // triggering the timer and call that explicitly in the approprate place. |
1502 // http://crbug.com/105065. | 1503 // http://crbug.com/105065. |
1503 browser_process_->notification_ui_manager(); | 1504 browser_process_->notification_ui_manager(); |
1504 | 1505 |
| 1506 // This must be called prior to RegisterComponentsForUpdate, in case the CLD |
| 1507 // data source is based on the Component Updater. |
| 1508 translate::BrowserCldUtils::ConfigureDefaultDataProvider(); |
| 1509 |
1505 if (!parsed_command_line().HasSwitch(switches::kDisableComponentUpdate)) | 1510 if (!parsed_command_line().HasSwitch(switches::kDisableComponentUpdate)) |
1506 RegisterComponentsForUpdate(); | 1511 RegisterComponentsForUpdate(); |
1507 | 1512 |
1508 #if defined(OS_ANDROID) | 1513 #if defined(OS_ANDROID) |
1509 chrome_variations::VariationsService* variations_service = | 1514 chrome_variations::VariationsService* variations_service = |
1510 browser_process_->variations_service(); | 1515 browser_process_->variations_service(); |
1511 if (variations_service) { | 1516 if (variations_service) { |
1512 variations_service->set_policy_pref_service(profile_->GetPrefs()); | 1517 variations_service->set_policy_pref_service(profile_->GetPrefs()); |
1513 variations_service->StartRepeatedVariationsSeedFetch(); | 1518 variations_service->StartRepeatedVariationsSeedFetch(); |
1514 } | 1519 } |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1711 chromeos::CrosSettings::Shutdown(); | 1716 chromeos::CrosSettings::Shutdown(); |
1712 #endif | 1717 #endif |
1713 #endif | 1718 #endif |
1714 } | 1719 } |
1715 | 1720 |
1716 // Public members: | 1721 // Public members: |
1717 | 1722 |
1718 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { | 1723 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { |
1719 chrome_extra_parts_.push_back(parts); | 1724 chrome_extra_parts_.push_back(parts); |
1720 } | 1725 } |
OLD | NEW |