| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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_BROWSER_TRANSLATE_TRANSLATE_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_TRANSLATE_TRANSLATE_MANAGER_H_ |
| 6 #define CHROME_BROWSER_TRANSLATE_TRANSLATE_MANAGER_H_ | 6 #define CHROME_BROWSER_TRANSLATE_TRANSLATE_MANAGER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/callback_list.h" | 12 #include "base/callback_list.h" |
| 13 #include "base/gtest_prod_util.h" | 13 #include "base/gtest_prod_util.h" |
| 14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
| 15 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
| 16 #include "components/translate/core/common/translate_errors.h" | 16 #include "components/translate/core/common/translate_errors.h" |
| 17 | 17 |
| 18 class GURL; | 18 class GURL; |
| 19 class PrefService; | 19 class PrefService; |
| 20 class TranslateClient; | 20 class TranslateClient; |
| 21 class TranslateDriver; | 21 class TranslateDriver; |
| 22 struct TranslateErrorDetails; | 22 struct TranslateErrorDetails; |
| 23 class TranslateTabHelper; | 23 class TranslateTabHelper; |
| 24 | 24 |
| 25 namespace content { | |
| 26 class WebContents; | |
| 27 } | |
| 28 | |
| 29 // The TranslateManager class is responsible for showing an info-bar when a page | 25 // The TranslateManager class is responsible for showing an info-bar when a page |
| 30 // in a language different than the user language is loaded. It triggers the | 26 // in a language different than the user language is loaded. It triggers the |
| 31 // page translation the user requests. | 27 // page translation the user requests. |
| 32 // TranslateManager expects its associated TranslateTabHelper to always have a | 28 // TranslateManager expects its associated TranslateTabHelper to always have a |
| 33 // valid WebContents (i.e. the WebContents is never destroyed within the | 29 // valid WebContents (i.e. the WebContents is never destroyed within the |
| 34 // lifetime of TranslateManager). | 30 // lifetime of TranslateManager). |
| 35 | 31 |
| 36 class TranslateManager { | 32 class TranslateManager { |
| 37 public: | 33 public: |
| 38 // TranslateTabHelper is expected to outlive the TranslateManager. | 34 // TranslateTabHelper is expected to outlive the TranslateManager. |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 TranslateTabHelper* translate_tab_helper_; // Weak. | 107 TranslateTabHelper* translate_tab_helper_; // Weak. |
| 112 TranslateClient* translate_client_; // Weak. | 108 TranslateClient* translate_client_; // Weak. |
| 113 TranslateDriver* translate_driver_; // Weak. | 109 TranslateDriver* translate_driver_; // Weak. |
| 114 | 110 |
| 115 base::WeakPtrFactory<TranslateManager> weak_method_factory_; | 111 base::WeakPtrFactory<TranslateManager> weak_method_factory_; |
| 116 | 112 |
| 117 DISALLOW_COPY_AND_ASSIGN(TranslateManager); | 113 DISALLOW_COPY_AND_ASSIGN(TranslateManager); |
| 118 }; | 114 }; |
| 119 | 115 |
| 120 #endif // CHROME_BROWSER_TRANSLATE_TRANSLATE_MANAGER_H_ | 116 #endif // CHROME_BROWSER_TRANSLATE_TRANSLATE_MANAGER_H_ |
| OLD | NEW |