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_INFOBAR_DELEGATE_H_ | 5 #ifndef COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_INFOBAR_DELEGATE_H_ |
6 #define COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_INFOBAR_DELEGATE_H_ | 6 #define COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_INFOBAR_DELEGATE_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 bool ShouldShowMessageInfoBarButton(); | 160 bool ShouldShowMessageInfoBarButton(); |
161 | 161 |
162 // Called by the before translate infobar to figure-out if it should show | 162 // Called by the before translate infobar to figure-out if it should show |
163 // an extra shortcut to let the user black-list/white-list that language | 163 // an extra shortcut to let the user black-list/white-list that language |
164 // (based on how many times the user accepted/declined translation). | 164 // (based on how many times the user accepted/declined translation). |
165 // The shortcut itself is platform specific, it can be a button or a new bar | 165 // The shortcut itself is platform specific, it can be a button or a new bar |
166 // for example. | 166 // for example. |
167 bool ShouldShowNeverTranslateShortcut(); | 167 bool ShouldShowNeverTranslateShortcut(); |
168 bool ShouldShowAlwaysTranslateShortcut(); | 168 bool ShouldShowAlwaysTranslateShortcut(); |
169 | 169 |
| 170 // Called by translate compact infobar. This check whether we should |
| 171 // automatically trigger "Always Translate". |
| 172 bool ShouldAutoAlwaysTranslate(); |
| 173 |
170 #if defined(OS_IOS) | 174 #if defined(OS_IOS) |
171 // Shows the Infobar offering to never translate the language or the site. | 175 // Shows the Infobar offering to never translate the language or the site. |
172 void ShowNeverTranslateInfobar(); | 176 void ShowNeverTranslateInfobar(); |
173 #endif | 177 #endif |
174 | 178 |
175 // Adds the strings that should be displayed in the after translate infobar to | 179 // Adds the strings that should be displayed in the after translate infobar to |
176 // |strings|. If |autodetermined_source_language| is false, the text in that | 180 // |strings|. If |autodetermined_source_language| is false, the text in that |
177 // infobar is: | 181 // infobar is: |
178 // "The page has been translated from <lang1> to <lang2>." | 182 // "The page has been translated from <lang1> to <lang2>." |
179 // Otherwise: | 183 // Otherwise: |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 | 236 |
233 // Whether the translation was triggered via a menu click vs automatically | 237 // Whether the translation was triggered via a menu click vs automatically |
234 // (due to language detection, preferences...) | 238 // (due to language detection, preferences...) |
235 bool triggered_from_menu_; | 239 bool triggered_from_menu_; |
236 DISALLOW_COPY_AND_ASSIGN(TranslateInfoBarDelegate); | 240 DISALLOW_COPY_AND_ASSIGN(TranslateInfoBarDelegate); |
237 }; | 241 }; |
238 | 242 |
239 } // namespace translate | 243 } // namespace translate |
240 | 244 |
241 #endif // COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_INFOBAR_DELEGATE_H_ | 245 #endif // COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_INFOBAR_DELEGATE_H_ |
OLD | NEW |