summaryrefslogtreecommitdiffstats
path: root/chrome/browser/chrome_browser_main.cc
diff options
context:
space:
mode:
authorandrewhayden <andrewhayden@chromium.org>2014-11-11 09:47:16 -0800
committerCommit bot <commit-bot@chromium.org>2014-11-11 17:47:36 +0000
commit14d91355848a733b18396d74c97d6b945260b899 (patch)
tree28bdfe9f0561e72b95a08552fc69e5a51af8224c /chrome/browser/chrome_browser_main.cc
parent7742fb4516ba94d8c0b6cdb8ddbb25839065642f (diff)
downloadchromium_src-14d91355848a733b18396d74c97d6b945260b899.zip
chromium_src-14d91355848a733b18396d74c97d6b945260b899.tar.gz
chromium_src-14d91355848a733b18396d74c97d6b945260b899.tar.bz2
Refactor language detection logic to allow non-static CLD data sources.
This change further refines the approach taken in setting the implementation used for accessing compact language detector at runtime. It is based upon the pattern used in content_client.h, though adapted for this specific use case. Fundamentally, there is a switch from having exactly one linked-in class define a global method to instead having the high-level targets (like the content shell, chrome shell, and so on) be responsible for setting the implementation that is desired. This eliminates a lot of the ugly GYP/GN logic, but requires work for each high-level target. BUG=367239 Review URL: https://codereview.chromium.org/461633002 Cr-Commit-Position: refs/heads/master@{#303669}
Diffstat (limited to 'chrome/browser/chrome_browser_main.cc')
-rw-r--r--chrome/browser/chrome_browser_main.cc11
1 files changed, 8 insertions, 3 deletions
diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc
index 239885b..3f65f35 100644
--- a/chrome/browser/chrome_browser_main.cc
+++ b/chrome/browser/chrome_browser_main.cc
@@ -110,6 +110,7 @@
#include "components/rappor/rappor_service.h"
#include "components/signin/core/common/profile_management_switches.h"
#include "components/startup_metric_utils/startup_metric_utils.h"
+#include "components/translate/content/browser/browser_cld_utils.h"
#include "components/translate/content/common/cld_data_source.h"
#include "components/translate/core/browser/translate_download_manager.h"
#include "components/variations/net/variations_http_header_provider.h"
@@ -421,9 +422,9 @@ void RegisterComponentsForUpdate() {
g_browser_process->pnacl_component_installer()->RegisterPnaclComponent(cus);
#endif
- if (translate::CldDataSource::ShouldRegisterForComponentUpdates()) {
- RegisterCldComponent(cus);
- }
+ // Registration of the CLD Component is a no-op unless the CLD data source has
+ // been configured to be the "Component" data source.
+ RegisterCldComponent(cus);
base::FilePath path;
if (PathService::Get(chrome::DIR_USER_DATA, &path)) {
@@ -1502,6 +1503,10 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
// http://crbug.com/105065.
browser_process_->notification_ui_manager();
+ // This must be called prior to RegisterComponentsForUpdate, in case the CLD
+ // data source is based on the Component Updater.
+ translate::BrowserCldUtils::ConfigureDefaultDataProvider();
+
if (!parsed_command_line().HasSwitch(switches::kDisableComponentUpdate))
RegisterComponentsForUpdate();