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

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: Fix linux/mac/windows compile issues 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chrome_browser_main.cc
diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc
index 6ab5340fc15c65e8b1683dcbaadd3f2439c3e8b8..6ffe3c512b9073d3d44952edf02ff8c1f88cedf1 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"
@@ -416,7 +417,8 @@ void RegisterComponentsForUpdate() {
g_browser_process->pnacl_component_installer()->RegisterPnaclComponent(cus);
#endif
- if (translate::CldDataSource::ShouldRegisterForComponentUpdates()) {
+ if (translate::CldDataSource::Get() ==
+ translate::CldDataSource::GetComponentDataSource()) {
RegisterCldComponent(cus);
}
@@ -1488,6 +1490,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();

Powered by Google App Engine
This is Rietveld 408576698