OLD | NEW |
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 CHROME_RENDERER_TRANSLATE_TRANSLATE_HELPER_H_ | 5 #ifndef CHROME_RENDERER_TRANSLATE_TRANSLATE_HELPER_H_ |
6 #define CHROME_RENDERER_TRANSLATE_TRANSLATE_HELPER_H_ | 6 #define CHROME_RENDERER_TRANSLATE_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 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 | 231 |
232 // The states associated with the current translation. | 232 // The states associated with the current translation. |
233 bool translation_pending_; | 233 bool translation_pending_; |
234 std::string source_lang_; | 234 std::string source_lang_; |
235 std::string target_lang_; | 235 std::string target_lang_; |
236 | 236 |
237 // Time when a page langauge is determined. This is used to know a duration | 237 // Time when a page langauge is determined. This is used to know a duration |
238 // time from showing infobar to requesting translation. | 238 // time from showing infobar to requesting translation. |
239 base::TimeTicks language_determined_time_; | 239 base::TimeTicks language_determined_time_; |
240 | 240 |
241 // Method factory used to make calls to TranslatePageImpl. | |
242 base::WeakPtrFactory<TranslateHelper> weak_method_factory_; | |
243 | |
244 // Provides CLD data for this process. | 241 // Provides CLD data for this process. |
245 scoped_ptr<translate::RendererCldDataProvider> cld_data_provider_; | 242 scoped_ptr<translate::RendererCldDataProvider> cld_data_provider_; |
246 | 243 |
247 // Whether or not polling for CLD2 data has started. | 244 // Whether or not polling for CLD2 data has started. |
248 bool cld_data_polling_started_; | 245 bool cld_data_polling_started_; |
249 | 246 |
250 // Whether or not CancelCldDataPolling has been called. | 247 // Whether or not CancelCldDataPolling has been called. |
251 bool cld_data_polling_canceled_; | 248 bool cld_data_polling_canceled_; |
252 | 249 |
253 // Whether or not a PageCaptured event arrived prior to CLD data becoming | 250 // Whether or not a PageCaptured event arrived prior to CLD data becoming |
254 // available. If true, deferred_contents_ contains the most recent contents. | 251 // available. If true, deferred_contents_ contains the most recent contents. |
255 bool deferred_page_capture_; | 252 bool deferred_page_capture_; |
256 | 253 |
257 // The ID of the page most recently reported to PageCaptured if | 254 // The ID of the page most recently reported to PageCaptured if |
258 // deferred_page_capture_ is true. | 255 // deferred_page_capture_ is true. |
259 int deferred_page_seq_no_; | 256 int deferred_page_seq_no_; |
260 | 257 |
261 // The contents of the page most recently reported to PageCaptured if | 258 // The contents of the page most recently reported to PageCaptured if |
262 // deferred_page_capture_ is true. | 259 // deferred_page_capture_ is true. |
263 base::string16 deferred_contents_; | 260 base::string16 deferred_contents_; |
264 | 261 |
| 262 // Method factory used to make calls to TranslatePageImpl. |
| 263 base::WeakPtrFactory<TranslateHelper> weak_method_factory_; |
| 264 |
265 DISALLOW_COPY_AND_ASSIGN(TranslateHelper); | 265 DISALLOW_COPY_AND_ASSIGN(TranslateHelper); |
266 }; | 266 }; |
267 | 267 |
268 #endif // CHROME_RENDERER_TRANSLATE_TRANSLATE_HELPER_H_ | 268 #endif // CHROME_RENDERER_TRANSLATE_TRANSLATE_HELPER_H_ |
OLD | NEW |