Chromium Code Reviews| 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_CORE_BROWSER_TRANSLATE_UI_DELEGATE_H_ | 5 #ifndef COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_UI_DELEGATE_H_ |
| 6 #define COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_UI_DELEGATE_H_ | 6 #define COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_UI_DELEGATE_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 112 void SetSiteBlacklist(bool value); | 112 void SetSiteBlacklist(bool value); |
| 113 | 113 |
| 114 // Returns true if the webpage in the current original language should be | 114 // Returns true if the webpage in the current original language should be |
| 115 // translated into the current target language automatically. | 115 // translated into the current target language automatically. |
| 116 bool ShouldAlwaysTranslate(); | 116 bool ShouldAlwaysTranslate(); |
| 117 | 117 |
| 118 // Sets the value if the webpage in the current original language should be | 118 // Sets the value if the webpage in the current original language should be |
| 119 // translated into the current target language automatically. | 119 // translated into the current target language automatically. |
| 120 void SetAlwaysTranslate(bool value); | 120 void SetAlwaysTranslate(bool value); |
| 121 | 121 |
| 122 // Return true if "Always translate" should be checked by default in the | |
|
msw
2016/05/03 22:33:35
optional nit: copy the comment from translate_bubb
ftang
2016/05/03 23:55:42
Done.
| |
| 123 // bubble UI. | |
| 124 bool ShouldAlwaysTranslateBeCheckedByDefault(); | |
| 125 | |
| 122 private: | 126 private: |
| 123 // Gets the host of the page being translated, or an empty string if no URL is | 127 // Gets the host of the page being translated, or an empty string if no URL is |
| 124 // associated with the current page. | 128 // associated with the current page. |
| 125 std::string GetPageHost(); | 129 std::string GetPageHost(); |
| 126 | 130 |
| 127 TranslateDriver* translate_driver_; | 131 TranslateDriver* translate_driver_; |
| 128 base::WeakPtr<TranslateManager> translate_manager_; | 132 base::WeakPtr<TranslateManager> translate_manager_; |
| 129 | 133 |
| 130 // ISO code (en, fr...) -> displayable name in the current locale | 134 // ISO code (en, fr...) -> displayable name in the current locale |
| 131 typedef std::pair<std::string, base::string16> LanguageNamePair; | 135 typedef std::pair<std::string, base::string16> LanguageNamePair; |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 149 | 153 |
| 150 // The translation related preferences. | 154 // The translation related preferences. |
| 151 std::unique_ptr<TranslatePrefs> prefs_; | 155 std::unique_ptr<TranslatePrefs> prefs_; |
| 152 | 156 |
| 153 DISALLOW_COPY_AND_ASSIGN(TranslateUIDelegate); | 157 DISALLOW_COPY_AND_ASSIGN(TranslateUIDelegate); |
| 154 }; | 158 }; |
| 155 | 159 |
| 156 } // namespace translate | 160 } // namespace translate |
| 157 | 161 |
| 158 #endif // COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_UI_DELEGATE_H_ | 162 #endif // COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_UI_DELEGATE_H_ |
| OLD | NEW |