OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_TRANSLATE_TRANSLATE_MANAGER_H_ |
6 #define CHROME_BROWSER_TRANSLATE_TRANSLATE_MANAGER_H_ | 6 #define CHROME_BROWSER_TRANSLATE_TRANSLATE_MANAGER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 void OnTranslateScriptFetchComplete(bool success, const std::string& data); | 192 void OnTranslateScriptFetchComplete(bool success, const std::string& data); |
193 | 193 |
194 // Notifies to the observers when a language is detected. | 194 // Notifies to the observers when a language is detected. |
195 void NotifyLanguageDetection(const LanguageDetectionDetails& details); | 195 void NotifyLanguageDetection(const LanguageDetectionDetails& details); |
196 | 196 |
197 // Notifies to the observers when translate failed. | 197 // Notifies to the observers when translate failed. |
198 void NotifyTranslateError(const TranslateErrorDetails& details); | 198 void NotifyTranslateError(const TranslateErrorDetails& details); |
199 | 199 |
200 // Shows the translate bubble. | 200 // Shows the translate bubble. |
201 void ShowBubble(content::WebContents* web_contents, | 201 void ShowBubble(content::WebContents* web_contents, |
202 TranslateBubbleModel::ViewState view_state); | 202 TranslateBubbleModel::ViewState view_state, |
| 203 TranslateErrors::Type error_type); |
203 | 204 |
204 // Returns the different parameters used to decide whether extra shortcuts | 205 // Returns the different parameters used to decide whether extra shortcuts |
205 // are needed. | 206 // are needed. |
206 static ShortcutConfiguration ShortcutConfig(); | 207 static ShortcutConfiguration ShortcutConfig(); |
207 | 208 |
208 content::NotificationRegistrar notification_registrar_; | 209 content::NotificationRegistrar notification_registrar_; |
209 | 210 |
210 // Max number of attempts before checking if a page has been reloaded. | 211 // Max number of attempts before checking if a page has been reloaded. |
211 int max_reload_check_attempts_; | 212 int max_reload_check_attempts_; |
212 | 213 |
(...skipping 15 matching lines...) Expand all Loading... |
228 // An instance of TranslateAcceptLanguages which manages Accept languages of | 229 // An instance of TranslateAcceptLanguages which manages Accept languages of |
229 // each profiles. | 230 // each profiles. |
230 scoped_ptr<TranslateAcceptLanguages> accept_languages_; | 231 scoped_ptr<TranslateAcceptLanguages> accept_languages_; |
231 | 232 |
232 base::WeakPtrFactory<TranslateManager> weak_method_factory_; | 233 base::WeakPtrFactory<TranslateManager> weak_method_factory_; |
233 | 234 |
234 DISALLOW_COPY_AND_ASSIGN(TranslateManager); | 235 DISALLOW_COPY_AND_ASSIGN(TranslateManager); |
235 }; | 236 }; |
236 | 237 |
237 #endif // CHROME_BROWSER_TRANSLATE_TRANSLATE_MANAGER_H_ | 238 #endif // CHROME_BROWSER_TRANSLATE_TRANSLATE_MANAGER_H_ |
OLD | NEW |