Chromium Code Reviews| 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> |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 48 // the UI language | 48 // the UI language |
| 49 // the accept-language list | 49 // the accept-language list |
| 50 // If no language is found then an empty string is returned. | 50 // If no language is found then an empty string is returned. |
| 51 static std::string GetTargetLanguage(PrefService* prefs); | 51 static std::string GetTargetLanguage(PrefService* prefs); |
| 52 | 52 |
| 53 // Returns the language to automatically translate to. |original_language| is | 53 // Returns the language to automatically translate to. |original_language| is |
| 54 // the webpage's original language. | 54 // the webpage's original language. |
| 55 static std::string GetAutoTargetLanguage(const std::string& original_language, | 55 static std::string GetAutoTargetLanguage(const std::string& original_language, |
| 56 PrefService* prefs); | 56 PrefService* prefs); |
| 57 | 57 |
| 58 // Sets the pair languages for translation to |source| and |target|. | |
|
groby-ooo-7-16
2014/03/21 01:21:42
It doesn't really set the languages, or am I misun
hajimehoshi
2014/03/24 07:16:30
Done.
| |
| 59 static void GetTranslateLanguages(content::WebContents* web_contents, | |
| 60 std::string* source, | |
| 61 std::string* target); | |
| 62 | |
| 58 // Translates the page contents from |source_lang| to |target_lang|. | 63 // Translates the page contents from |source_lang| to |target_lang|. |
| 59 // The actual translation might be performed asynchronously if the translate | 64 // The actual translation might be performed asynchronously if the translate |
| 60 // script is not yet available. | 65 // script is not yet available. |
| 61 void TranslatePage(const std::string& source_lang, | 66 void TranslatePage(const std::string& source_lang, |
| 62 const std::string& target_lang, | 67 const std::string& target_lang, |
| 63 bool triggered_from_menu); | 68 bool triggered_from_menu); |
| 64 | 69 |
| 65 // Reverts the contents of the page to its original language. | 70 // Reverts the contents of the page to its original language. |
| 66 void RevertTranslation(); | 71 void RevertTranslation(); |
| 67 | 72 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 119 int max_reload_check_attempts_; | 124 int max_reload_check_attempts_; |
| 120 | 125 |
| 121 TranslateTabHelper* translate_tab_helper_; // Weak. | 126 TranslateTabHelper* translate_tab_helper_; // Weak. |
| 122 | 127 |
| 123 base::WeakPtrFactory<TranslateManager> weak_method_factory_; | 128 base::WeakPtrFactory<TranslateManager> weak_method_factory_; |
| 124 | 129 |
| 125 DISALLOW_COPY_AND_ASSIGN(TranslateManager); | 130 DISALLOW_COPY_AND_ASSIGN(TranslateManager); |
| 126 }; | 131 }; |
| 127 | 132 |
| 128 #endif // CHROME_BROWSER_TRANSLATE_TRANSLATE_MANAGER_H_ | 133 #endif // CHROME_BROWSER_TRANSLATE_TRANSLATE_MANAGER_H_ |
| OLD | NEW |