Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1263)

Side by Side Diff: chrome/browser/chrome_browser_main.cc

Issue 461633002: Refactor language detection logic to allow non-static CLD data sources. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 1052 matching lines...) Expand 10 before | Expand all | Expand 10 after
1482 PrefMetricsService::Factory::GetForProfile(profile_); 1484 PrefMetricsService::Factory::GetForProfile(profile_);
1483 1485
1484 PreBrowserStart(); 1486 PreBrowserStart();
1485 1487
1486 // Instantiate the notification UI manager, as this triggers a perf timer 1488 // Instantiate the notification UI manager, as this triggers a perf timer
1487 // used to measure startup time. TODO(stevenjb): Figure out what is actually 1489 // used to measure startup time. TODO(stevenjb): Figure out what is actually
1488 // triggering the timer and call that explicitly in the approprate place. 1490 // triggering the timer and call that explicitly in the approprate place.
1489 // http://crbug.com/105065. 1491 // http://crbug.com/105065.
1490 browser_process_->notification_ui_manager(); 1492 browser_process_->notification_ui_manager();
1491 1493
1494 // This must be called prior to RegisterComponentsForUpdate, in case the CLD
1495 // data source is based on the Component Updater.
1496 translate::BrowserCldUtils::ConfigureDefaultDataProvider();
1497
1492 if (!parsed_command_line().HasSwitch(switches::kDisableComponentUpdate)) 1498 if (!parsed_command_line().HasSwitch(switches::kDisableComponentUpdate))
1493 RegisterComponentsForUpdate(); 1499 RegisterComponentsForUpdate();
1494 1500
1495 #if defined(OS_ANDROID) 1501 #if defined(OS_ANDROID)
1496 chrome_variations::VariationsService* variations_service = 1502 chrome_variations::VariationsService* variations_service =
1497 browser_process_->variations_service(); 1503 browser_process_->variations_service();
1498 if (variations_service) { 1504 if (variations_service) {
1499 variations_service->set_policy_pref_service(profile_->GetPrefs()); 1505 variations_service->set_policy_pref_service(profile_->GetPrefs());
1500 variations_service->StartRepeatedVariationsSeedFetch(); 1506 variations_service->StartRepeatedVariationsSeedFetch();
1501 } 1507 }
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
1698 chromeos::CrosSettings::Shutdown(); 1704 chromeos::CrosSettings::Shutdown();
1699 #endif 1705 #endif
1700 #endif 1706 #endif
1701 } 1707 }
1702 1708
1703 // Public members: 1709 // Public members:
1704 1710
1705 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { 1711 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) {
1706 chrome_extra_parts_.push_back(parts); 1712 chrome_extra_parts_.push_back(parts);
1707 } 1713 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698