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

Unified Diff: components/translate/content/renderer/translate_helper.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 | « components/translate/content/renderer/translate_helper.h ('k') | third_party/cld_2/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/translate/content/renderer/translate_helper.cc
diff --git a/components/translate/content/renderer/translate_helper.cc b/components/translate/content/renderer/translate_helper.cc
index 5aff9c8c259e2a73ca4ec61a91ed18986a2134da..e2da2f99163cd1da4e52e4e22ce09c1f308781d1 100644
--- a/components/translate/content/renderer/translate_helper.cc
+++ b/components/translate/content/renderer/translate_helper.cc
@@ -13,6 +13,8 @@
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "components/translate/content/common/translate_messages.h"
+#include "components/translate/content/renderer/renderer_cld_data_provider.h"
+#include "components/translate/content/renderer/renderer_cld_utils.h"
#include "components/translate/core/common/translate_constants.h"
#include "components/translate/core/common/translate_metrics.h"
#include "components/translate/core/common/translate_util.h"
@@ -82,7 +84,8 @@ TranslateHelper::TranslateHelper(content::RenderView* render_view,
: content::RenderViewObserver(render_view),
page_seq_no_(0),
translation_pending_(false),
- cld_data_provider_(translate::CreateRendererCldDataProviderFor(this)),
+ cld_data_provider_(
+ static_cast<translate::RendererCldDataProvider*>(NULL)),
cld_data_polling_started_(false),
cld_data_polling_canceled_(false),
deferred_page_capture_(false),
@@ -91,6 +94,8 @@ TranslateHelper::TranslateHelper(content::RenderView* render_view,
extension_group_(extension_group),
extension_scheme_(extension_scheme),
weak_method_factory_(this) {
+ translate::RendererCldUtils::ConfigureDefaultDataProvider();
+ cld_data_provider_ = translate::RendererCldDataProvider::Get();
}
TranslateHelper::~TranslateHelper() {
« no previous file with comments | « components/translate/content/renderer/translate_helper.h ('k') | third_party/cld_2/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698