OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_UI_DELEGATE_H_ | 5 #ifndef COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_UI_DELEGATE_H_ |
6 #define COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_UI_DELEGATE_H_ | 6 #define COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_UI_DELEGATE_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 // Returns the displayable name for the language at |index|. | 81 // Returns the displayable name for the language at |index|. |
82 base::string16 GetLanguageNameAt(size_t index) const; | 82 base::string16 GetLanguageNameAt(size_t index) const; |
83 | 83 |
84 // Starts translating the current page. | 84 // Starts translating the current page. |
85 void Translate(); | 85 void Translate(); |
86 | 86 |
87 // Reverts translation. | 87 // Reverts translation. |
88 void RevertTranslation(); | 88 void RevertTranslation(); |
89 | 89 |
90 // Processes when the user declines translation. | 90 // Processes when the user declines translation. |
| 91 // The function name is not accurate. It only means the user did not take |
| 92 // affirmative action after the translation ui show up. The user either |
| 93 // actively decline the translation or ignore the prompt of translation. |
| 94 // Pass |explicitly_closed| as true if user explicityly decline the |
| 95 // translation. |
| 96 // Pass |explicitly_closed| as false if the translation UI is dismissed |
| 97 // implicit by some user actions which ignore the translation UI, |
| 98 // such as switch to a new tab/window or navigate to another page by |
| 99 // click a link. |
91 void TranslationDeclined(bool explicitly_closed); | 100 void TranslationDeclined(bool explicitly_closed); |
92 | 101 |
93 // Returns true if the current language is blocked. | 102 // Returns true if the current language is blocked. |
94 bool IsLanguageBlocked(); | 103 bool IsLanguageBlocked(); |
95 | 104 |
96 // Sets the value if the current language is blocked. | 105 // Sets the value if the current language is blocked. |
97 void SetLanguageBlocked(bool value); | 106 void SetLanguageBlocked(bool value); |
98 | 107 |
99 // Returns true if the current webpage is blacklisted. | 108 // Returns true if the current webpage is blacklisted. |
100 bool IsSiteBlacklisted(); | 109 bool IsSiteBlacklisted(); |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 | 149 |
141 // The translation related preferences. | 150 // The translation related preferences. |
142 scoped_ptr<TranslatePrefs> prefs_; | 151 scoped_ptr<TranslatePrefs> prefs_; |
143 | 152 |
144 DISALLOW_COPY_AND_ASSIGN(TranslateUIDelegate); | 153 DISALLOW_COPY_AND_ASSIGN(TranslateUIDelegate); |
145 }; | 154 }; |
146 | 155 |
147 } // namespace translate | 156 } // namespace translate |
148 | 157 |
149 #endif // COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_UI_DELEGATE_H_ | 158 #endif // COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_UI_DELEGATE_H_ |
OLD | NEW |