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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
51 // types, |original_language| and |target_language| must be ASCII language | 51 // types, |original_language| and |target_language| must be ASCII language |
52 // codes (e.g. "en", "fr", etc.) for languages the TranslateManager supports | 52 // codes (e.g. "en", "fr", etc.) for languages the TranslateManager supports |
53 // translating. The lone exception is when the user initiates translation | 53 // translating. The lone exception is when the user initiates translation |
54 // from the context menu, in which case it's legal to call this with | 54 // from the context menu, in which case it's legal to call this with |
55 // |infobar_type| == TRANSLATING and | 55 // |infobar_type| == TRANSLATING and |
56 // |original_language| == kUnknownLanguageCode. | 56 // |original_language| == kUnknownLanguageCode. |
57 // | 57 // |
58 // If |replace_existing_infobar| is true, the infobar is created and added to | 58 // If |replace_existing_infobar| is true, the infobar is created and added to |
59 // |infobar_service|, replacing any other translate infobar already present | 59 // |infobar_service|, replacing any other translate infobar already present |
60 // there. Otherwise, the infobar will only be added if there is no other | 60 // there. Otherwise, the infobar will only be added if there is no other |
61 // translate infobar already present. | 61 // translate infobar already present. |
Peter Kasting
2013/06/21 17:23:59
Nit: Consider updating this comment to describe yo
| |
62 static void Create(InfoBarService* infobar_service, | 62 static void Create(InfoBarService* infobar_service, |
63 bool replace_existing_infobar, | 63 bool replace_existing_infobar, |
64 Type infobar_type, | 64 Type infobar_type, |
65 TranslateErrors::Type error_type, | 65 TranslateErrors::Type error_type, |
66 PrefService* prefs, | 66 PrefService* prefs, |
67 const ShortcutConfiguration& shortcut_config, | 67 const ShortcutConfiguration& shortcut_config, |
68 const std::string& original_language, | 68 const std::string& original_language, |
69 const std::string& target_language); | 69 const std::string& target_language); |
70 | 70 |
71 // Returns the number of languages supported. | 71 // Returns the number of languages supported. |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
141 // several times). | 141 // several times). |
142 void AlwaysTranslatePageLanguage(); | 142 void AlwaysTranslatePageLanguage(); |
143 void NeverTranslatePageLanguage(); | 143 void NeverTranslatePageLanguage(); |
144 | 144 |
145 // The following methods are called by the infobar that displays the status | 145 // The following methods are called by the infobar that displays the status |
146 // while translating and also the one displaying the error message. | 146 // while translating and also the one displaying the error message. |
147 string16 GetMessageInfoBarText(); | 147 string16 GetMessageInfoBarText(); |
148 string16 GetMessageInfoBarButtonText(); | 148 string16 GetMessageInfoBarButtonText(); |
149 void MessageInfoBarButtonPressed(); | 149 void MessageInfoBarButtonPressed(); |
150 bool ShouldShowMessageInfoBarButton(); | 150 bool ShouldShowMessageInfoBarButton(); |
151 bool InTranslateNavigation(); | |
152 | 151 |
153 // Called by the before translate infobar to figure-out if it should show | 152 // Called by the before translate infobar to figure-out if it should show |
154 // an extra shortcut to let the user black-list/white-list that language | 153 // an extra shortcut to let the user black-list/white-list that language |
155 // (based on how many times the user accepted/declined translation). | 154 // (based on how many times the user accepted/declined translation). |
156 // The shortcut itself is platform specific, it can be a button or a new bar | 155 // The shortcut itself is platform specific, it can be a button or a new bar |
157 // for example. | 156 // for example. |
158 bool ShouldShowNeverTranslateShortcut(); | 157 bool ShouldShowNeverTranslateShortcut(); |
159 bool ShouldShowAlwaysTranslateShortcut(); | 158 bool ShouldShowAlwaysTranslateShortcut(); |
160 | 159 |
161 // Sets this infobar background animation based on the previous infobar shown. | 160 // Sets this infobar background animation based on the previous infobar shown. |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
238 | 237 |
239 // The translation related preferences. | 238 // The translation related preferences. |
240 TranslatePrefs prefs_; | 239 TranslatePrefs prefs_; |
241 | 240 |
242 // Translation shortcut configuration | 241 // Translation shortcut configuration |
243 ShortcutConfiguration shortcut_config_; | 242 ShortcutConfiguration shortcut_config_; |
244 DISALLOW_COPY_AND_ASSIGN(TranslateInfoBarDelegate); | 243 DISALLOW_COPY_AND_ASSIGN(TranslateInfoBarDelegate); |
245 }; | 244 }; |
246 | 245 |
247 #endif // CHROME_BROWSER_TRANSLATE_TRANSLATE_INFOBAR_DELEGATE_H_ | 246 #endif // CHROME_BROWSER_TRANSLATE_TRANSLATE_INFOBAR_DELEGATE_H_ |
OLD | NEW |