OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "chrome/browser/ui/gtk/infobars/infobar_gtk.h" | 9 #include "chrome/browser/ui/gtk/infobars/infobar_gtk.h" |
10 #include "ui/base/animation/animation_delegate.h" | 10 #include "ui/gfx/animation/animation_delegate.h" |
11 | 11 |
12 class TranslateInfoBarDelegate; | 12 class TranslateInfoBarDelegate; |
13 | 13 |
14 // This class contains some of the base functionality that translate infobars | 14 // This class contains some of the base functionality that translate infobars |
15 // use. | 15 // use. |
16 class TranslateInfoBarBase : public InfoBarGtk { | 16 class TranslateInfoBarBase : public InfoBarGtk { |
17 protected: | 17 protected: |
18 TranslateInfoBarBase(InfoBarService* owner, | 18 TranslateInfoBarBase(InfoBarService* owner, |
19 TranslateInfoBarDelegate* delegate); | 19 TranslateInfoBarDelegate* delegate); |
20 virtual ~TranslateInfoBarBase(); | 20 virtual ~TranslateInfoBarBase(); |
21 | 21 |
22 // InfoBarGtk: | 22 // InfoBarGtk: |
23 virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE; | 23 virtual void AnimationProgressed(const gfx::Animation* animation) OVERRIDE; |
24 virtual void GetTopColor(InfoBarDelegate::Type type, | 24 virtual void GetTopColor(InfoBarDelegate::Type type, |
25 double* r, double* g, double* b) OVERRIDE; | 25 double* r, double* g, double* b) OVERRIDE; |
26 virtual void GetBottomColor(InfoBarDelegate::Type type, | 26 virtual void GetBottomColor(InfoBarDelegate::Type type, |
27 double* r, double* g, double* b) OVERRIDE; | 27 double* r, double* g, double* b) OVERRIDE; |
28 virtual void InitWidgets() OVERRIDE; | 28 virtual void InitWidgets() OVERRIDE; |
29 | 29 |
30 // Sub-classes that want to have the options menu button showing should | 30 // Sub-classes that want to have the options menu button showing should |
31 // override and return true. | 31 // override and return true. |
32 virtual bool ShowOptionsMenuButton() const; | 32 virtual bool ShowOptionsMenuButton() const; |
33 | 33 |
(...skipping 24 matching lines...) Expand all Loading... |
58 }; | 58 }; |
59 | 59 |
60 CHROMEGTK_CALLBACK_0(TranslateInfoBarBase, void, OnOptionsClicked); | 60 CHROMEGTK_CALLBACK_0(TranslateInfoBarBase, void, OnOptionsClicked); |
61 | 61 |
62 // A percentage to average the normal page action background with the error | 62 // A percentage to average the normal page action background with the error |
63 // background. When 0, the infobar background should be pure PAGE_ACTION_TYPE. | 63 // background. When 0, the infobar background should be pure PAGE_ACTION_TYPE. |
64 // When 1, the infobar background should be pure WARNING_TYPE. | 64 // When 1, the infobar background should be pure WARNING_TYPE. |
65 double background_error_percent_; | 65 double background_error_percent_; |
66 | 66 |
67 // Changes the color of the background from normal to error color and back. | 67 // Changes the color of the background from normal to error color and back. |
68 scoped_ptr<ui::SlideAnimation> background_color_animation_; | 68 scoped_ptr<gfx::SlideAnimation> background_color_animation_; |
69 | 69 |
70 // The model for the current menu displayed. | 70 // The model for the current menu displayed. |
71 scoped_ptr<ui::MenuModel> menu_model_; | 71 scoped_ptr<ui::MenuModel> menu_model_; |
72 | 72 |
73 DISALLOW_COPY_AND_ASSIGN(TranslateInfoBarBase); | 73 DISALLOW_COPY_AND_ASSIGN(TranslateInfoBarBase); |
74 }; | 74 }; |
75 | 75 |
76 #endif // CHROME_BROWSER_UI_GTK_INFOBARS_TRANSLATE_INFOBAR_BASE_GTK_H_ | 76 #endif // CHROME_BROWSER_UI_GTK_INFOBARS_TRANSLATE_INFOBAR_BASE_GTK_H_ |
OLD | NEW |