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

Side by Side Diff: components/translate/content/renderer/translate_helper.h

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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef COMPONENTS_TRANSLATE_CONTENT_RENDERER_TRANSLATE_HELPER_H_ 5 #ifndef COMPONENTS_TRANSLATE_CONTENT_RENDERER_TRANSLATE_HELPER_H_
6 #define COMPONENTS_TRANSLATE_CONTENT_RENDERER_TRANSLATE_HELPER_H_ 6 #define COMPONENTS_TRANSLATE_CONTENT_RENDERER_TRANSLATE_HELPER_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/gtest_prod_util.h" 10 #include "base/gtest_prod_util.h"
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 // The states associated with the current translation. 237 // The states associated with the current translation.
238 bool translation_pending_; 238 bool translation_pending_;
239 std::string source_lang_; 239 std::string source_lang_;
240 std::string target_lang_; 240 std::string target_lang_;
241 241
242 // Time when a page langauge is determined. This is used to know a duration 242 // Time when a page langauge is determined. This is used to know a duration
243 // time from showing infobar to requesting translation. 243 // time from showing infobar to requesting translation.
244 base::TimeTicks language_determined_time_; 244 base::TimeTicks language_determined_time_;
245 245
246 // Provides CLD data for this process. 246 // Provides CLD data for this process.
247 scoped_ptr<RendererCldDataProvider> cld_data_provider_; 247 // The pointer is owned by the global in RendererCldDataProvider and has the
248 // same lifetime as the process itself, so this field is simply a raw pointer
249 // instead of a scoped_ptr.
250 RendererCldDataProvider* cld_data_provider_;
248 251
249 // Whether or not polling for CLD2 data has started. 252 // Whether or not polling for CLD2 data has started.
250 bool cld_data_polling_started_; 253 bool cld_data_polling_started_;
251 254
252 // Whether or not CancelCldDataPolling has been called. 255 // Whether or not CancelCldDataPolling has been called.
253 bool cld_data_polling_canceled_; 256 bool cld_data_polling_canceled_;
254 257
255 // Whether or not a PageCaptured event arrived prior to CLD data becoming 258 // Whether or not a PageCaptured event arrived prior to CLD data becoming
256 // available. If true, deferred_contents_ contains the most recent contents. 259 // available. If true, deferred_contents_ contains the most recent contents.
257 bool deferred_page_capture_; 260 bool deferred_page_capture_;
(...skipping 17 matching lines...) Expand all
275 278
276 // Method factory used to make calls to TranslatePageImpl. 279 // Method factory used to make calls to TranslatePageImpl.
277 base::WeakPtrFactory<TranslateHelper> weak_method_factory_; 280 base::WeakPtrFactory<TranslateHelper> weak_method_factory_;
278 281
279 DISALLOW_COPY_AND_ASSIGN(TranslateHelper); 282 DISALLOW_COPY_AND_ASSIGN(TranslateHelper);
280 }; 283 };
281 284
282 } // namespace translate 285 } // namespace translate
283 286
284 #endif // COMPONENTS_TRANSLATE_CONTENT_RENDERER_TRANSLATE_HELPER_H_ 287 #endif // COMPONENTS_TRANSLATE_CONTENT_RENDERER_TRANSLATE_HELPER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698