OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_INFOBAR_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_TRANSLATE_TRANSLATE_INFOBAR_DELEGATE_H_ |
6 #define CHROME_BROWSER_TRANSLATE_TRANSLATE_INFOBAR_DELEGATE_H_ | 6 #define CHROME_BROWSER_TRANSLATE_TRANSLATE_INFOBAR_DELEGATE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 bool ShouldShowMessageInfoBarButton(); | 137 bool ShouldShowMessageInfoBarButton(); |
138 | 138 |
139 // Called by the before translate infobar to figure-out if it should show | 139 // Called by the before translate infobar to figure-out if it should show |
140 // an extra shortcut to let the user black-list/white-list that language | 140 // an extra shortcut to let the user black-list/white-list that language |
141 // (based on how many times the user accepted/declined translation). | 141 // (based on how many times the user accepted/declined translation). |
142 // The shortcut itself is platform specific, it can be a button or a new bar | 142 // The shortcut itself is platform specific, it can be a button or a new bar |
143 // for example. | 143 // for example. |
144 bool ShouldShowNeverTranslateShortcut(); | 144 bool ShouldShowNeverTranslateShortcut(); |
145 bool ShouldShowAlwaysTranslateShortcut(); | 145 bool ShouldShowAlwaysTranslateShortcut(); |
146 | 146 |
| 147 // Returns the WebContents associated with the TranslateInfoBarDelegate. |
| 148 content::WebContents* GetWebContents(); |
| 149 |
147 // Convenience method that returns the displayable language name for | 150 // Convenience method that returns the displayable language name for |
148 // |language_code| in the current application locale. | 151 // |language_code| in the current application locale. |
149 static base::string16 GetLanguageDisplayableName( | 152 static base::string16 GetLanguageDisplayableName( |
150 const std::string& language_code); | 153 const std::string& language_code); |
151 | 154 |
152 // Adds the strings that should be displayed in the after translate infobar to | 155 // Adds the strings that should be displayed in the after translate infobar to |
153 // |strings|. If |autodetermined_source_language| is false, the text in that | 156 // |strings|. If |autodetermined_source_language| is false, the text in that |
154 // infobar is: | 157 // infobar is: |
155 // "The page has been translated from <lang1> to <lang2>." | 158 // "The page has been translated from <lang1> to <lang2>." |
156 // Otherwise: | 159 // Otherwise: |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 // The translation related preferences. | 207 // The translation related preferences. |
205 scoped_ptr<TranslatePrefs> prefs_; | 208 scoped_ptr<TranslatePrefs> prefs_; |
206 | 209 |
207 // Whether the translation was triggered via a menu click vs automatically | 210 // Whether the translation was triggered via a menu click vs automatically |
208 // (due to language detection, preferences...) | 211 // (due to language detection, preferences...) |
209 bool triggered_from_menu_; | 212 bool triggered_from_menu_; |
210 DISALLOW_COPY_AND_ASSIGN(TranslateInfoBarDelegate); | 213 DISALLOW_COPY_AND_ASSIGN(TranslateInfoBarDelegate); |
211 }; | 214 }; |
212 | 215 |
213 #endif // CHROME_BROWSER_TRANSLATE_TRANSLATE_INFOBAR_DELEGATE_H_ | 216 #endif // CHROME_BROWSER_TRANSLATE_TRANSLATE_INFOBAR_DELEGATE_H_ |
OLD | NEW |