| 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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 // Adds the strings that should be displayed in the after translate infobar to | 168 // Adds the strings that should be displayed in the after translate infobar to |
| 169 // |strings|. The text in that infobar is: | 169 // |strings|. The text in that infobar is: |
| 170 // "The page has been translated from <lang1> to <lang2>." | 170 // "The page has been translated from <lang1> to <lang2>." |
| 171 // Because <lang1> and <lang2> are displayed in menu buttons, the text is | 171 // Because <lang1> and <lang2> are displayed in menu buttons, the text is |
| 172 // split in 3 chunks. |swap_languages| is set to true if <lang1> and <lang2> | 172 // split in 3 chunks. |swap_languages| is set to true if <lang1> and <lang2> |
| 173 // should be inverted (some languages express the sentense as "The page has | 173 // should be inverted (some languages express the sentense as "The page has |
| 174 // been translate to <lang2> from <lang1>."). | 174 // been translate to <lang2> from <lang1>."). |
| 175 static void GetAfterTranslateStrings(std::vector<string16>* strings, | 175 static void GetAfterTranslateStrings(std::vector<string16>* strings, |
| 176 bool* swap_languages); | 176 bool* swap_languages); |
| 177 | 177 |
| 178 // Adds the strings that should be displayed in the after translate infobar to |
| 179 // |strings|. When a source language is not determined by Chrome, Languages |
| 180 // are detected by a server automatically. And infobar doesn't show source |
| 181 // languages. The text in the infobar is: |
| 182 // "The page has been translated to <lang1>." |
| 183 // Because <lang1> is displayed in a menu button, the text is split in 2 |
| 184 // chunks. |
| 185 static void GetAfterTranslateWithAutoStrings(std::vector<string16>* strings); |
| 186 |
| 178 protected: | 187 protected: |
| 179 // For testing. | 188 // For testing. |
| 180 TranslateInfoBarDelegate(Type infobar_type, | 189 TranslateInfoBarDelegate(Type infobar_type, |
| 181 TranslateErrors::Type error_type, | 190 TranslateErrors::Type error_type, |
| 182 InfoBarService* infobar_service, | 191 InfoBarService* infobar_service, |
| 183 PrefService* prefs, | 192 PrefService* prefs, |
| 184 ShortcutConfiguration shortcut_config, | 193 ShortcutConfiguration shortcut_config, |
| 185 const std::string& original_language, | 194 const std::string& original_language, |
| 186 const std::string& target_language); | 195 const std::string& target_language); |
| 187 Type infobar_type_; | 196 Type infobar_type_; |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 | 239 |
| 231 // The translation related preferences. | 240 // The translation related preferences. |
| 232 TranslatePrefs prefs_; | 241 TranslatePrefs prefs_; |
| 233 | 242 |
| 234 // Translation shortcut configuration | 243 // Translation shortcut configuration |
| 235 ShortcutConfiguration shortcut_config_; | 244 ShortcutConfiguration shortcut_config_; |
| 236 DISALLOW_COPY_AND_ASSIGN(TranslateInfoBarDelegate); | 245 DISALLOW_COPY_AND_ASSIGN(TranslateInfoBarDelegate); |
| 237 }; | 246 }; |
| 238 | 247 |
| 239 #endif // CHROME_BROWSER_TRANSLATE_TRANSLATE_INFOBAR_DELEGATE_H_ | 248 #endif // CHROME_BROWSER_TRANSLATE_TRANSLATE_INFOBAR_DELEGATE_H_ |
| OLD | NEW |