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_UI_GTK_INFOBARS_TRANSLATE_INFOBAR_BASE_GTK_H_ | 5 #ifndef CHROME_BROWSER_UI_GTK_INFOBARS_TRANSLATE_INFOBAR_BASE_GTK_H_ |
6 #define CHROME_BROWSER_UI_GTK_INFOBARS_TRANSLATE_INFOBAR_BASE_GTK_H_ | 6 #define CHROME_BROWSER_UI_GTK_INFOBARS_TRANSLATE_INFOBAR_BASE_GTK_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
| 9 #include "base/compiler_specific.h" |
9 #include "chrome/browser/ui/gtk/infobars/infobar_gtk.h" | 10 #include "chrome/browser/ui/gtk/infobars/infobar_gtk.h" |
10 #include "ui/base/animation/animation_delegate.h" | 11 #include "ui/base/animation/animation_delegate.h" |
11 | 12 |
12 class TranslateInfoBarDelegate; | 13 class TranslateInfoBarDelegate; |
13 | 14 |
14 // This class contains some of the base functionality that translate infobars | 15 // This class contains some of the base functionality that translate infobars |
15 // use. | 16 // use. |
16 class TranslateInfoBarBase : public InfoBarGtk { | 17 class TranslateInfoBarBase : public InfoBarGtk { |
17 public: | 18 public: |
18 TranslateInfoBarBase(InfoBarTabHelper* owner, | 19 TranslateInfoBarBase(InfoBarTabHelper* owner, |
19 TranslateInfoBarDelegate* delegate); | 20 TranslateInfoBarDelegate* delegate); |
20 virtual ~TranslateInfoBarBase(); | 21 virtual ~TranslateInfoBarBase(); |
21 | 22 |
22 // Initializes the infobar widgets. Should be called after the object has been | 23 // Initializes the infobar widgets. Should be called after the object has been |
23 // created. | 24 // created. |
24 virtual void Init(); | 25 virtual void Init(); |
25 | 26 |
26 // Overridden from InfoBar: | 27 // Overridden from InfoBar: |
27 virtual void GetTopColor(InfoBarDelegate::Type type, | 28 virtual void GetTopColor(InfoBarDelegate::Type type, |
28 double* r, double* g, double* b); | 29 double* r, double* g, double* b) OVERRIDE; |
29 virtual void GetBottomColor(InfoBarDelegate::Type type, | 30 virtual void GetBottomColor(InfoBarDelegate::Type type, |
30 double* r, double* g, double* b); | 31 double* r, double* g, double* b) OVERRIDE; |
31 | 32 |
32 // Overridden from ui::AnimationDelegate: | 33 // Overridden from ui::AnimationDelegate: |
33 virtual void AnimationProgressed(const ui::Animation* animation); | 34 virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE; |
34 | 35 |
35 protected: | 36 protected: |
36 // Sub-classes that want to have the options menu button showing sould | 37 // Sub-classes that want to have the options menu button showing sould |
37 // override and return true. | 38 // override and return true. |
38 virtual bool ShowOptionsMenuButton() const; | 39 virtual bool ShowOptionsMenuButton() const; |
39 | 40 |
40 // Creates a combobox that displays the languages currently available. | 41 // Creates a combobox that displays the languages currently available. |
41 // |selected_language| is the language index (as used in the | 42 // |selected_language| is the language index (as used in the |
42 // TranslateInfoBarDelegate) that should be selected initially. | 43 // TranslateInfoBarDelegate) that should be selected initially. |
43 // |exclude_language| is the language index of the language that should not be | 44 // |exclude_language| is the language index of the language that should not be |
(...skipping 21 matching lines...) Expand all Loading... |
65 // When 1, the infobar background should be pure WARNING_TYPE. | 66 // When 1, the infobar background should be pure WARNING_TYPE. |
66 double background_error_percent_; | 67 double background_error_percent_; |
67 | 68 |
68 // Changes the color of the background from normal to error color and back. | 69 // Changes the color of the background from normal to error color and back. |
69 scoped_ptr<ui::SlideAnimation> background_color_animation_; | 70 scoped_ptr<ui::SlideAnimation> background_color_animation_; |
70 | 71 |
71 DISALLOW_COPY_AND_ASSIGN(TranslateInfoBarBase); | 72 DISALLOW_COPY_AND_ASSIGN(TranslateInfoBarBase); |
72 }; | 73 }; |
73 | 74 |
74 #endif // CHROME_BROWSER_UI_GTK_INFOBARS_TRANSLATE_INFOBAR_BASE_GTK_H_ | 75 #endif // CHROME_BROWSER_UI_GTK_INFOBARS_TRANSLATE_INFOBAR_BASE_GTK_H_ |
OLD | NEW |