| 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 |
| 27 // Content implementation of TranslateDriver. | 26 // Content implementation of TranslateDriver. |
| 28 class ContentTranslateDriver : public TranslateDriver, | 27 class ContentTranslateDriver : public TranslateDriver, |
| 29 public content::WebContentsObserver { | 28 public content::WebContentsObserver { |
| 30 public: | 29 public: |
| 31 | 30 |
| 32 // The observer for the ContentTranslateDriver. | 31 // The observer for the ContentTranslateDriver. |
| 33 class Observer { | 32 class Observer { |
| 34 public: | 33 public: |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 // The navigation controller of the tab we are associated with. | 108 // The navigation controller of the tab we are associated with. |
| 110 content::NavigationController* navigation_controller_; | 109 content::NavigationController* navigation_controller_; |
| 111 | 110 |
| 112 TranslateManager* translate_manager_; | 111 TranslateManager* translate_manager_; |
| 113 | 112 |
| 114 base::ObserverList<Observer, true> observer_list_; | 113 base::ObserverList<Observer, true> observer_list_; |
| 115 | 114 |
| 116 // Max number of attempts before checking if a page has been reloaded. | 115 // Max number of attempts before checking if a page has been reloaded. |
| 117 int max_reload_check_attempts_; | 116 int max_reload_check_attempts_; |
| 118 | 117 |
| 119 // Provides CLD data for this process. | |
| 120 std::unique_ptr<translate::BrowserCldDataProvider> cld_data_provider_; | |
| 121 | |
| 122 base::WeakPtrFactory<ContentTranslateDriver> weak_pointer_factory_; | 118 base::WeakPtrFactory<ContentTranslateDriver> weak_pointer_factory_; |
| 123 | 119 |
| 124 DISALLOW_COPY_AND_ASSIGN(ContentTranslateDriver); | 120 DISALLOW_COPY_AND_ASSIGN(ContentTranslateDriver); |
| 125 }; | 121 }; |
| 126 | 122 |
| 127 } // namespace translate | 123 } // namespace translate |
| 128 | 124 |
| 129 #endif // COMPONENTS_TRANSLATE_CONTENT_BROWSER_CONTENT_TRANSLATE_DRIVER_H_ | 125 #endif // COMPONENTS_TRANSLATE_CONTENT_BROWSER_CONTENT_TRANSLATE_DRIVER_H_ |
| OLD | NEW |