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

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: Fix merge error in chrome/browser/BUILD.gn Created 6 years, 2 months 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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 #include "chrome/installer/util/google_update_settings.h" 101 #include "chrome/installer/util/google_update_settings.h"
102 #include "components/component_updater/component_updater_service.h" 102 #include "components/component_updater/component_updater_service.h"
103 #include "components/google/core/browser/google_util.h" 103 #include "components/google/core/browser/google_util.h"
104 #include "components/language_usage_metrics/language_usage_metrics.h" 104 #include "components/language_usage_metrics/language_usage_metrics.h"
105 #include "components/metrics/metrics_service.h" 105 #include "components/metrics/metrics_service.h"
106 #include "components/metrics/profiler/tracking_synchronizer.h" 106 #include "components/metrics/profiler/tracking_synchronizer.h"
107 #include "components/nacl/browser/nacl_browser.h" 107 #include "components/nacl/browser/nacl_browser.h"
108 #include "components/rappor/rappor_service.h" 108 #include "components/rappor/rappor_service.h"
109 #include "components/signin/core/common/profile_management_switches.h" 109 #include "components/signin/core/common/profile_management_switches.h"
110 #include "components/startup_metric_utils/startup_metric_utils.h" 110 #include "components/startup_metric_utils/startup_metric_utils.h"
111 #include "components/translate/content/browser/browser_cld_utils.h"
111 #include "components/translate/content/common/cld_data_source.h" 112 #include "components/translate/content/common/cld_data_source.h"
112 #include "components/translate/core/browser/translate_download_manager.h" 113 #include "components/translate/core/browser/translate_download_manager.h"
113 #include "components/variations/variations_http_header_provider.h" 114 #include "components/variations/variations_http_header_provider.h"
114 #include "content/public/browser/browser_thread.h" 115 #include "content/public/browser/browser_thread.h"
115 #include "content/public/browser/notification_observer.h" 116 #include "content/public/browser/notification_observer.h"
116 #include "content/public/browser/notification_registrar.h" 117 #include "content/public/browser/notification_registrar.h"
117 #include "content/public/browser/notification_service.h" 118 #include "content/public/browser/notification_service.h"
118 #include "content/public/browser/notification_types.h" 119 #include "content/public/browser/notification_types.h"
119 #include "content/public/browser/site_instance.h" 120 #include "content/public/browser/site_instance.h"
120 #include "content/public/common/content_client.h" 121 #include "content/public/common/content_client.h"
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
400 #if !defined(OS_CHROMEOS) && !defined(OS_ANDROID) 401 #if !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
401 RegisterRecoveryComponent(cus, g_browser_process->local_state()); 402 RegisterRecoveryComponent(cus, g_browser_process->local_state());
402 RegisterPepperFlashComponent(cus); 403 RegisterPepperFlashComponent(cus);
403 RegisterSwiftShaderComponent(cus); 404 RegisterSwiftShaderComponent(cus);
404 RegisterWidevineCdmComponent(cus); 405 RegisterWidevineCdmComponent(cus);
405 #if !defined(DISABLE_NACL) 406 #if !defined(DISABLE_NACL)
406 g_browser_process->pnacl_component_installer()->RegisterPnaclComponent(cus); 407 g_browser_process->pnacl_component_installer()->RegisterPnaclComponent(cus);
407 #endif 408 #endif
408 #endif 409 #endif
409 410
410 if (translate::CldDataSource::ShouldRegisterForComponentUpdates()) { 411 if (translate::CldDataSource::Get()->ShouldRegisterForComponentUpdates()) {
411 RegisterCldComponent(cus); 412 RegisterCldComponent(cus);
412 } 413 }
413 414
414 base::FilePath path; 415 base::FilePath path;
415 if (PathService::Get(chrome::DIR_USER_DATA, &path)) { 416 if (PathService::Get(chrome::DIR_USER_DATA, &path)) {
416 #if defined(OS_ANDROID) 417 #if defined(OS_ANDROID)
417 // The CRLSet component was enabled for some releases. This code attempts to 418 // The CRLSet component was enabled for some releases. This code attempts to
418 // delete it from the local disk of those how may have downloaded it. 419 // delete it from the local disk of those how may have downloaded it.
419 g_browser_process->crl_set_fetcher()->DeleteFromDisk(path); 420 g_browser_process->crl_set_fetcher()->DeleteFromDisk(path);
420 #elif !defined(OS_CHROMEOS) 421 #elif !defined(OS_CHROMEOS)
(...skipping 1037 matching lines...) Expand 10 before | Expand all | Expand 10 after
1458 PrefMetricsService::Factory::GetForProfile(profile_); 1459 PrefMetricsService::Factory::GetForProfile(profile_);
1459 1460
1460 PreBrowserStart(); 1461 PreBrowserStart();
1461 1462
1462 // Instantiate the notification UI manager, as this triggers a perf timer 1463 // Instantiate the notification UI manager, as this triggers a perf timer
1463 // used to measure startup time. TODO(stevenjb): Figure out what is actually 1464 // used to measure startup time. TODO(stevenjb): Figure out what is actually
1464 // triggering the timer and call that explicitly in the approprate place. 1465 // triggering the timer and call that explicitly in the approprate place.
1465 // http://crbug.com/105065. 1466 // http://crbug.com/105065.
1466 browser_process_->notification_ui_manager(); 1467 browser_process_->notification_ui_manager();
1467 1468
1469 // This must be called prior to RegisterComponentsForUpdate, in case the CLD
1470 // data source is based on the Component Updater.
1471 translate::BrowserCldUtils::ConfigureDefaultDataProvider();
1472
1468 if (!parsed_command_line().HasSwitch(switches::kDisableComponentUpdate)) 1473 if (!parsed_command_line().HasSwitch(switches::kDisableComponentUpdate))
1469 RegisterComponentsForUpdate(); 1474 RegisterComponentsForUpdate();
1470 1475
1471 #if defined(OS_ANDROID) 1476 #if defined(OS_ANDROID)
1472 chrome_variations::VariationsService* variations_service = 1477 chrome_variations::VariationsService* variations_service =
1473 browser_process_->variations_service(); 1478 browser_process_->variations_service();
1474 if (variations_service) { 1479 if (variations_service) {
1475 variations_service->set_policy_pref_service(profile_->GetPrefs()); 1480 variations_service->set_policy_pref_service(profile_->GetPrefs());
1476 variations_service->StartRepeatedVariationsSeedFetch(); 1481 variations_service->StartRepeatedVariationsSeedFetch();
1477 } 1482 }
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
1676 chromeos::CrosSettings::Shutdown(); 1681 chromeos::CrosSettings::Shutdown();
1677 #endif 1682 #endif
1678 #endif 1683 #endif
1679 } 1684 }
1680 1685
1681 // Public members: 1686 // Public members:
1682 1687
1683 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { 1688 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) {
1684 chrome_extra_parts_.push_back(parts); 1689 chrome_extra_parts_.push_back(parts);
1685 } 1690 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698