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

Unified 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: Make some of the harness factory methods private 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/BUILD.gn ('k') | chrome/browser/component_updater/cld_component_installer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chrome_browser_main.cc
diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc
index 239885bbbb2db46ae6eb1386d6be15526e9029b0..3f65f354c154e4b87a7a033b43048d576a404096 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();
« no previous file with comments | « chrome/browser/BUILD.gn ('k') | chrome/browser/component_updater/cld_component_installer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698