Index: chrome/browser/chrome_browser_main.cc |
diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc |
index ed87ac28c6cfeaf49c6fd14d2ab2d2617356f724..be2706a4b9799c2dd78840fd2432253a6bb9479a 100644 |
--- a/chrome/browser/chrome_browser_main.cc |
+++ b/chrome/browser/chrome_browser_main.cc |
@@ -108,6 +108,9 @@ |
#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_data_provider_factory.h" |
+#include "components/translate/content/browser/static_browser_cld_data_provider.h" |
+#include "components/translate/content/browser/static_browser_cld_data_provider_factory.h" |
#include "components/translate/content/common/cld_data_source.h" |
#include "components/translate/core/browser/translate_download_manager.h" |
#include "components/variations/variations_http_header_provider.h" |
@@ -407,7 +410,7 @@ void RegisterComponentsForUpdate() { |
#endif |
#endif |
- if (translate::CldDataSource::ShouldRegisterForComponentUpdates()) { |
+ if (translate::CldDataSource::Get()->ShouldRegisterForComponentUpdates()) { |
RegisterCldComponent(cus); |
} |
@@ -1463,6 +1466,17 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { |
// http://crbug.com/105065. |
browser_process_->notification_ui_manager(); |
+ if (!translate::BrowserCldDataProviderFactory::IsInitialized()) { |
+ // Embedder hasn't specified an alternative factory, so we should set one. |
+ // This must happen before calling RegisterComponentsForUpdate, because |
+ // that code will register the CLD Component Updater if needed. |
+ // Maintainers: Customize the default data source here as desired. |
Andrew Hayden (chromium.org)
2014/09/26 10:22:49
Should have a note here for embedders, too, explai
Andrew Hayden (chromium.org)
2014/10/28 15:18:39
This is gone now.
|
+ translate::CldDataSource::Set(translate::CldDataSource::STATIC(), false); |
+ translate::BrowserCldDataProviderFactory* factory = |
+ new translate::StaticBrowserCldDataProviderFactory(); |
+ translate::BrowserCldDataProviderFactory::Set(factory, false); |
+ } |
+ |
if (!parsed_command_line().HasSwitch(switches::kDisableComponentUpdate)) |
RegisterComponentsForUpdate(); |