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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
| 10 #include <utility> |
10 #include <vector> | 11 #include <vector> |
11 | 12 |
12 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
13 #include "chrome/browser/infobars/infobar_delegate.h" | 14 #include "chrome/browser/infobars/infobar_delegate.h" |
14 #include "chrome/browser/translate/translate_prefs.h" | 15 #include "chrome/browser/translate/translate_prefs.h" |
15 #include "chrome/common/translate_errors.h" | 16 #include "chrome/common/translate_errors.h" |
16 | 17 |
17 class PrefService; | 18 class PrefService; |
18 class SkBitmap; | |
19 class TranslateInfoBarView; | 19 class TranslateInfoBarView; |
20 | 20 |
21 class TranslateInfoBarDelegate : public InfoBarDelegate { | 21 class TranslateInfoBarDelegate : public InfoBarDelegate { |
22 public: | 22 public: |
23 // The different types of infobars that can be shown for translation. | 23 // The different types of infobars that can be shown for translation. |
24 enum Type { | 24 enum Type { |
25 BEFORE_TRANSLATE, | 25 BEFORE_TRANSLATE, |
26 TRANSLATING, | 26 TRANSLATING, |
27 AFTER_TRANSLATE, | 27 AFTER_TRANSLATE, |
28 TRANSLATION_ERROR | 28 TRANSLATION_ERROR |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 Type type_; | 160 Type type_; |
161 | 161 |
162 private: | 162 private: |
163 typedef std::pair<std::string, string16> LanguageNamePair; | 163 typedef std::pair<std::string, string16> LanguageNamePair; |
164 | 164 |
165 // InfoBarDelegate: | 165 // InfoBarDelegate: |
166 virtual InfoBar* CreateInfoBar(InfoBarTabHelper* infobar_helper) OVERRIDE; | 166 virtual InfoBar* CreateInfoBar(InfoBarTabHelper* infobar_helper) OVERRIDE; |
167 virtual void InfoBarDismissed() OVERRIDE; | 167 virtual void InfoBarDismissed() OVERRIDE; |
168 virtual gfx::Image* GetIcon() const OVERRIDE; | 168 virtual gfx::Image* GetIcon() const OVERRIDE; |
169 virtual InfoBarDelegate::Type GetInfoBarType() const OVERRIDE; | 169 virtual InfoBarDelegate::Type GetInfoBarType() const OVERRIDE; |
170 virtual bool ShouldExpire( | 170 virtual bool ShouldExpire( |
171 const content::LoadCommittedDetails& details) const; | 171 const content::LoadCommittedDetails& details) const OVERRIDE; |
172 virtual TranslateInfoBarDelegate* AsTranslateInfoBarDelegate() OVERRIDE; | 172 virtual TranslateInfoBarDelegate* AsTranslateInfoBarDelegate() OVERRIDE; |
173 | 173 |
174 // Gets the host of the page being translated, or an empty string if no URL is | 174 // Gets the host of the page being translated, or an empty string if no URL is |
175 // associated with the current page. | 175 // associated with the current page. |
176 std::string GetPageHost(); | 176 std::string GetPageHost(); |
177 | 177 |
178 // The type of fading animation if any that should be used when showing this | 178 // The type of fading animation if any that should be used when showing this |
179 // infobar. | 179 // infobar. |
180 BackgroundAnimationType background_animation_; | 180 BackgroundAnimationType background_animation_; |
181 | 181 |
(...skipping 22 matching lines...) Expand all Loading... |
204 // The current infobar view. | 204 // The current infobar view. |
205 TranslateInfoBarView* infobar_view_; | 205 TranslateInfoBarView* infobar_view_; |
206 | 206 |
207 // The translation related preferences. | 207 // The translation related preferences. |
208 TranslatePrefs prefs_; | 208 TranslatePrefs prefs_; |
209 | 209 |
210 DISALLOW_COPY_AND_ASSIGN(TranslateInfoBarDelegate); | 210 DISALLOW_COPY_AND_ASSIGN(TranslateInfoBarDelegate); |
211 }; | 211 }; |
212 | 212 |
213 #endif // CHROME_BROWSER_TRANSLATE_TRANSLATE_INFOBAR_DELEGATE_H_ | 213 #endif // CHROME_BROWSER_TRANSLATE_TRANSLATE_INFOBAR_DELEGATE_H_ |
OLD | NEW |