| Index: components/translate/core/browser/translate_manager.h
|
| diff --git a/chrome/browser/translate/translate_manager.h b/components/translate/core/browser/translate_manager.h
|
| similarity index 83%
|
| rename from chrome/browser/translate/translate_manager.h
|
| rename to components/translate/core/browser/translate_manager.h
|
| index 894c6c923149c65cef5dfac9f4f37e7d9e348e05..0ad98ecc887d7bd00cc45ed32ad97d7e15163ede 100644
|
| --- a/chrome/browser/translate/translate_manager.h
|
| +++ b/components/translate/core/browser/translate_manager.h
|
| @@ -2,8 +2,8 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#ifndef CHROME_BROWSER_TRANSLATE_TRANSLATE_MANAGER_H_
|
| -#define CHROME_BROWSER_TRANSLATE_TRANSLATE_MANAGER_H_
|
| +#ifndef COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_MANAGER_H_
|
| +#define COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_MANAGER_H_
|
|
|
| #include <map>
|
| #include <string>
|
| @@ -19,22 +19,19 @@ class GURL;
|
| class PrefService;
|
| class TranslateClient;
|
| class TranslateDriver;
|
| +class TranslatePrefs;
|
| struct TranslateErrorDetails;
|
| -class TranslateTabHelper;
|
|
|
| // The TranslateManager class is responsible for showing an info-bar when a page
|
| // in a language different than the user language is loaded. It triggers the
|
| // page translation the user requests.
|
| -// TranslateManager expects its associated TranslateTabHelper to always have a
|
| -// valid WebContents (i.e. the WebContents is never destroyed within the
|
| -// lifetime of TranslateManager).
|
|
|
| class TranslateManager {
|
| public:
|
| - // TranslateTabHelper is expected to outlive the TranslateManager.
|
| + // |translate_client| is expected to outlive the TranslateManager.
|
| // |accept_language_pref_name| is the path for the preference for the
|
| // accept-languages.
|
| - TranslateManager(TranslateTabHelper* helper,
|
| + TranslateManager(TranslateClient* translate_client,
|
| const std::string& accept_language_pref_name);
|
| virtual ~TranslateManager();
|
|
|
| @@ -50,7 +47,7 @@ class TranslateManager {
|
| // Returns the language to automatically translate to. |original_language| is
|
| // the webpage's original language.
|
| static std::string GetAutoTargetLanguage(const std::string& original_language,
|
| - PrefService* prefs);
|
| + TranslatePrefs* translate_prefs);
|
|
|
| // Translates the page contents from |source_lang| to |target_lang|.
|
| // The actual translation might be performed asynchronously if the translate
|
| @@ -102,10 +99,7 @@ class TranslateManager {
|
| // Preference name for the Accept-Languages HTTP header.
|
| std::string accept_languages_pref_name_;
|
|
|
| - // TODO(droger): Remove all uses of |translate_tab_helper_|, use
|
| - // TranslateClient and TranslateDriver instead.
|
| - TranslateTabHelper* translate_tab_helper_; // Weak.
|
| - TranslateClient* translate_client_; // Weak.
|
| + TranslateClient* translate_client_; // Weak.
|
| TranslateDriver* translate_driver_; // Weak.
|
|
|
| base::WeakPtrFactory<TranslateManager> weak_method_factory_;
|
| @@ -113,4 +107,4 @@ class TranslateManager {
|
| DISALLOW_COPY_AND_ASSIGN(TranslateManager);
|
| };
|
|
|
| -#endif // CHROME_BROWSER_TRANSLATE_TRANSLATE_MANAGER_H_
|
| +#endif // COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_MANAGER_H_
|
|
|