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 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
409 #if !defined(DISABLE_NACL) && !defined(OS_ANDROID) | 410 #if !defined(DISABLE_NACL) && !defined(OS_ANDROID) |
410 #if defined(OS_CHROMEOS) | 411 #if defined(OS_CHROMEOS) |
411 // PNaCl on Chrome OS is on rootfs and there is no need to download it. But | 412 // PNaCl on Chrome OS is on rootfs and there is no need to download it. But |
412 // Chrome4ChromeOS on Linux doesn't contain PNaCl so enable component | 413 // Chrome4ChromeOS on Linux doesn't contain PNaCl so enable component |
413 // installer when ruining on Linux. See crbug.com/422121 for more details. | 414 // installer when ruining on Linux. See crbug.com/422121 for more details. |
414 if (!base::SysInfo::IsRunningOnChromeOS()) | 415 if (!base::SysInfo::IsRunningOnChromeOS()) |
415 #endif | 416 #endif |
416 g_browser_process->pnacl_component_installer()->RegisterPnaclComponent(cus); | 417 g_browser_process->pnacl_component_installer()->RegisterPnaclComponent(cus); |
417 #endif | 418 #endif |
418 | 419 |
419 if (translate::CldDataSource::ShouldRegisterForComponentUpdates()) { | 420 if (translate::CldDataSource::Get() == |
| 421 translate::CldDataSource::GetComponentDataSource()) { |
420 RegisterCldComponent(cus); | 422 RegisterCldComponent(cus); |
421 } | 423 } |
422 | 424 |
423 base::FilePath path; | 425 base::FilePath path; |
424 if (PathService::Get(chrome::DIR_USER_DATA, &path)) { | 426 if (PathService::Get(chrome::DIR_USER_DATA, &path)) { |
425 #if defined(OS_ANDROID) | 427 #if defined(OS_ANDROID) |
426 // The CRLSet component was enabled for some releases. This code attempts to | 428 // The CRLSet component was enabled for some releases. This code attempts to |
427 // delete it from the local disk of those how may have downloaded it. | 429 // delete it from the local disk of those how may have downloaded it. |
428 g_browser_process->crl_set_fetcher()->DeleteFromDisk(path); | 430 g_browser_process->crl_set_fetcher()->DeleteFromDisk(path); |
429 #elif !defined(OS_CHROMEOS) | 431 #elif !defined(OS_CHROMEOS) |
(...skipping 1051 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1481 PrefMetricsService::Factory::GetForProfile(profile_); | 1483 PrefMetricsService::Factory::GetForProfile(profile_); |
1482 | 1484 |
1483 PreBrowserStart(); | 1485 PreBrowserStart(); |
1484 | 1486 |
1485 // Instantiate the notification UI manager, as this triggers a perf timer | 1487 // Instantiate the notification UI manager, as this triggers a perf timer |
1486 // used to measure startup time. TODO(stevenjb): Figure out what is actually | 1488 // used to measure startup time. TODO(stevenjb): Figure out what is actually |
1487 // triggering the timer and call that explicitly in the approprate place. | 1489 // triggering the timer and call that explicitly in the approprate place. |
1488 // http://crbug.com/105065. | 1490 // http://crbug.com/105065. |
1489 browser_process_->notification_ui_manager(); | 1491 browser_process_->notification_ui_manager(); |
1490 | 1492 |
| 1493 // This must be called prior to RegisterComponentsForUpdate, in case the CLD |
| 1494 // data source is based on the Component Updater. |
| 1495 translate::BrowserCldUtils::ConfigureDefaultDataProvider(); |
| 1496 |
1491 if (!parsed_command_line().HasSwitch(switches::kDisableComponentUpdate)) | 1497 if (!parsed_command_line().HasSwitch(switches::kDisableComponentUpdate)) |
1492 RegisterComponentsForUpdate(); | 1498 RegisterComponentsForUpdate(); |
1493 | 1499 |
1494 #if defined(OS_ANDROID) | 1500 #if defined(OS_ANDROID) |
1495 chrome_variations::VariationsService* variations_service = | 1501 chrome_variations::VariationsService* variations_service = |
1496 browser_process_->variations_service(); | 1502 browser_process_->variations_service(); |
1497 if (variations_service) { | 1503 if (variations_service) { |
1498 variations_service->set_policy_pref_service(profile_->GetPrefs()); | 1504 variations_service->set_policy_pref_service(profile_->GetPrefs()); |
1499 variations_service->StartRepeatedVariationsSeedFetch(); | 1505 variations_service->StartRepeatedVariationsSeedFetch(); |
1500 } | 1506 } |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1697 chromeos::CrosSettings::Shutdown(); | 1703 chromeos::CrosSettings::Shutdown(); |
1698 #endif | 1704 #endif |
1699 #endif | 1705 #endif |
1700 } | 1706 } |
1701 | 1707 |
1702 // Public members: | 1708 // Public members: |
1703 | 1709 |
1704 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { | 1710 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { |
1705 chrome_extra_parts_.push_back(parts); | 1711 chrome_extra_parts_.push_back(parts); |
1706 } | 1712 } |
OLD | NEW |