OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_BROWSER_CONTENT_TRANSLATE_DRIVER_H_ | 5 #ifndef COMPONENTS_TRANSLATE_CONTENT_BROWSER_CONTENT_TRANSLATE_DRIVER_H_ |
6 #define COMPONENTS_TRANSLATE_CONTENT_BROWSER_CONTENT_TRANSLATE_DRIVER_H_ | 6 #define COMPONENTS_TRANSLATE_CONTENT_BROWSER_CONTENT_TRANSLATE_DRIVER_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
10 #include "base/observer_list.h" | 10 #include "base/observer_list.h" |
11 #include "components/translate/core/browser/translate_driver.h" | 11 #include "components/translate/core/browser/translate_driver.h" |
12 #include "components/translate/core/common/translate_errors.h" | 12 #include "components/translate/core/common/translate_errors.h" |
13 #include "content/public/browser/web_contents_observer.h" | 13 #include "content/public/browser/web_contents_observer.h" |
14 | 14 |
15 namespace content { | 15 namespace content { |
16 class NavigationController; | 16 class NavigationController; |
17 class WebContents; | 17 class WebContents; |
18 } | 18 } |
19 | 19 |
20 namespace translate { | 20 namespace translate { |
21 | 21 |
22 struct LanguageDetectionDetails; | 22 struct LanguageDetectionDetails; |
23 class TranslateManager; | 23 class TranslateManager; |
| 24 class BrowserCldDataProvider; |
| 25 |
24 | 26 |
25 // Content implementation of TranslateDriver. | 27 // Content implementation of TranslateDriver. |
26 class ContentTranslateDriver : public TranslateDriver, | 28 class ContentTranslateDriver : public TranslateDriver, |
27 public content::WebContentsObserver { | 29 public content::WebContentsObserver { |
28 public: | 30 public: |
29 | 31 |
30 // The observer for the ContentTranslateDriver. | 32 // The observer for the ContentTranslateDriver. |
31 class Observer { | 33 class Observer { |
32 public: | 34 public: |
33 // Handles when the value of IsPageTranslated is changed. | 35 // Handles when the value of IsPageTranslated is changed. |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 // The navigation controller of the tab we are associated with. | 109 // The navigation controller of the tab we are associated with. |
108 content::NavigationController* navigation_controller_; | 110 content::NavigationController* navigation_controller_; |
109 | 111 |
110 TranslateManager* translate_manager_; | 112 TranslateManager* translate_manager_; |
111 | 113 |
112 base::ObserverList<Observer, true> observer_list_; | 114 base::ObserverList<Observer, true> observer_list_; |
113 | 115 |
114 // Max number of attempts before checking if a page has been reloaded. | 116 // Max number of attempts before checking if a page has been reloaded. |
115 int max_reload_check_attempts_; | 117 int max_reload_check_attempts_; |
116 | 118 |
| 119 // Provides CLD data for this process. |
| 120 scoped_ptr<translate::BrowserCldDataProvider> cld_data_provider_; |
| 121 |
117 base::WeakPtrFactory<ContentTranslateDriver> weak_pointer_factory_; | 122 base::WeakPtrFactory<ContentTranslateDriver> weak_pointer_factory_; |
118 | 123 |
119 DISALLOW_COPY_AND_ASSIGN(ContentTranslateDriver); | 124 DISALLOW_COPY_AND_ASSIGN(ContentTranslateDriver); |
120 }; | 125 }; |
121 | 126 |
122 } // namespace translate | 127 } // namespace translate |
123 | 128 |
124 #endif // COMPONENTS_TRANSLATE_CONTENT_BROWSER_CONTENT_TRANSLATE_DRIVER_H_ | 129 #endif // COMPONENTS_TRANSLATE_CONTENT_BROWSER_CONTENT_TRANSLATE_DRIVER_H_ |
OLD | NEW |