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 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "chrome/browser/tab_contents/infobar_delegate.h" | 11 #include "chrome/browser/tab_contents/infobar_delegate.h" |
12 #include "chrome/browser/translate/translate_prefs.h" | 12 #include "chrome/browser/translate/translate_prefs.h" |
13 #include "chrome/common/translate_errors.h" | 13 #include "chrome/common/translate_errors.h" |
14 | 14 |
15 class SkBitmap; | 15 class SkBitmap; |
16 class TranslateInfoBarView; | 16 class TranslateInfoBarView; |
17 | 17 |
18 class TranslateInfoBarDelegate : public InfoBarDelegate { | 18 class TranslateInfoBarDelegate : public InfoBarDelegate { |
19 public: | 19 public: |
20 // The different types of infobars that can be shown for translation. | 20 // The different types of infobars that can be shown for translation. |
21 enum Type { | 21 enum Type { |
22 kBeforeTranslate, | 22 BEFORE_TRANSLATE, |
23 kTranslating, | 23 TRANSLATING, |
24 kAfterTranslate, | 24 AFTER_TRANSLATE, |
25 kTranslationError | 25 TRANSLATION_ERROR |
26 }; | 26 }; |
27 | 27 |
28 // The types of background color animations. | 28 // The types of background color animations. |
29 enum BackgroundAnimationType { | 29 enum BackgroundAnimationType { |
30 kNone, | 30 NONE, |
31 kNormalToError, | 31 NORMAL_TO_ERROR, |
32 kErrorToNormal | 32 ERROR_TO_NORMAL |
33 }; | 33 }; |
34 | 34 |
35 // Factory method to create a non-error translate infobar. | 35 // Factory method to create a non-error translate infobar. |
36 // The original and target language specified are the ASCII language codes | 36 // The original and target language specified are the ASCII language codes |
37 // (ex: en, fr...). | 37 // (ex: en, fr...). |
38 // Returns NULL if it failed, typically if |original_language| or | 38 // Returns NULL if it failed, typically if |original_language| or |
39 // |target_language| is not a supported language. | 39 // |target_language| is not a supported language. |
40 static TranslateInfoBarDelegate* CreateDelegate( | 40 static TranslateInfoBarDelegate* CreateDelegate( |
41 Type infobar_type, | 41 Type infobar_type, |
42 TabContents* tab_contents, | 42 TabContents* tab_contents, |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 // The current infobar view. | 197 // The current infobar view. |
198 TranslateInfoBarView* infobar_view_; | 198 TranslateInfoBarView* infobar_view_; |
199 | 199 |
200 // The translation related preferences. | 200 // The translation related preferences. |
201 TranslatePrefs prefs_; | 201 TranslatePrefs prefs_; |
202 | 202 |
203 DISALLOW_COPY_AND_ASSIGN(TranslateInfoBarDelegate); | 203 DISALLOW_COPY_AND_ASSIGN(TranslateInfoBarDelegate); |
204 }; | 204 }; |
205 | 205 |
206 #endif // CHROME_BROWSER_TRANSLATE_TRANSLATE_INFOBAR_DELEGATE_H_ | 206 #endif // CHROME_BROWSER_TRANSLATE_TRANSLATE_INFOBAR_DELEGATE_H_ |
OLD | NEW |