OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 const std::string& original_language, | 44 const std::string& original_language, |
45 const std::string& target_language); | 45 const std::string& target_language); |
46 | 46 |
47 // Factory method to create an error translate infobar. | 47 // Factory method to create an error translate infobar. |
48 static TranslateInfoBarDelegate* CreateErrorDelegate( | 48 static TranslateInfoBarDelegate* CreateErrorDelegate( |
49 TranslateErrors::Type error_type, | 49 TranslateErrors::Type error_type, |
50 TabContents* tab_contents, | 50 TabContents* tab_contents, |
51 const std::string& original_language, | 51 const std::string& original_language, |
52 const std::string& target_language); | 52 const std::string& target_language); |
53 | 53 |
| 54 virtual ~TranslateInfoBarDelegate(); |
| 55 |
54 // Returns the number of languages supported. | 56 // Returns the number of languages supported. |
55 int GetLanguageCount() const; | 57 int GetLanguageCount() const; |
56 | 58 |
57 // Returns the ISO code for the language at |index|. | 59 // Returns the ISO code for the language at |index|. |
58 std::string GetLanguageCodeAt(int index) const; | 60 std::string GetLanguageCodeAt(int index) const; |
59 | 61 |
60 // Returns the displayable name for the language at |index|. | 62 // Returns the displayable name for the language at |index|. |
61 string16 GetLanguageDisplayableNameAt(int index) const; | 63 string16 GetLanguageDisplayableNameAt(int index) const; |
62 | 64 |
63 TabContents* tab_contents() const { return tab_contents_; } | 65 TabContents* tab_contents() const { return tab_contents_; } |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 // Called when the user declines to translate a page, by either closing the | 97 // Called when the user declines to translate a page, by either closing the |
96 // infobar or pressing the "Don't translate" button. | 98 // infobar or pressing the "Don't translate" button. |
97 void TranslationDeclined(); | 99 void TranslationDeclined(); |
98 | 100 |
99 // InfoBarDelegate implementation: | 101 // InfoBarDelegate implementation: |
100 virtual InfoBar* CreateInfoBar(); | 102 virtual InfoBar* CreateInfoBar(); |
101 virtual void InfoBarDismissed(); | 103 virtual void InfoBarDismissed(); |
102 virtual void InfoBarClosed(); | 104 virtual void InfoBarClosed(); |
103 virtual SkBitmap* GetIcon() const; | 105 virtual SkBitmap* GetIcon() const; |
104 virtual InfoBarDelegate::Type GetInfoBarType(); | 106 virtual InfoBarDelegate::Type GetInfoBarType(); |
105 virtual TranslateInfoBarDelegate* AsTranslateInfoBarDelegate() { | 107 virtual TranslateInfoBarDelegate* AsTranslateInfoBarDelegate(); |
106 return this; | |
107 } | |
108 | 108 |
109 // Methods called by the Options menu delegate. | 109 // Methods called by the Options menu delegate. |
110 virtual bool IsLanguageBlacklisted(); | 110 virtual bool IsLanguageBlacklisted(); |
111 virtual void ToggleLanguageBlacklist(); | 111 virtual void ToggleLanguageBlacklist(); |
112 virtual bool IsSiteBlacklisted(); | 112 virtual bool IsSiteBlacklisted(); |
113 virtual void ToggleSiteBlacklist(); | 113 virtual void ToggleSiteBlacklist(); |
114 virtual bool ShouldAlwaysTranslate(); | 114 virtual bool ShouldAlwaysTranslate(); |
115 virtual void ToggleAlwaysTranslate(); | 115 virtual void ToggleAlwaysTranslate(); |
116 | 116 |
117 // Methods called by the extra-buttons that can appear on the "before | 117 // Methods called by the extra-buttons that can appear on the "before |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 // The current infobar view. | 199 // The current infobar view. |
200 TranslateInfoBarView* infobar_view_; | 200 TranslateInfoBarView* infobar_view_; |
201 | 201 |
202 // The translation related preferences. | 202 // The translation related preferences. |
203 TranslatePrefs prefs_; | 203 TranslatePrefs prefs_; |
204 | 204 |
205 DISALLOW_COPY_AND_ASSIGN(TranslateInfoBarDelegate); | 205 DISALLOW_COPY_AND_ASSIGN(TranslateInfoBarDelegate); |
206 }; | 206 }; |
207 | 207 |
208 #endif // CHROME_BROWSER_TRANSLATE_TRANSLATE_INFOBAR_DELEGATE_H_ | 208 #endif // CHROME_BROWSER_TRANSLATE_TRANSLATE_INFOBAR_DELEGATE_H_ |
OLD | NEW |