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_EXTENSION_INFOBAR_GTK_H_ | 5 #ifndef CHROME_BROWSER_UI_GTK_INFOBARS_EXTENSION_INFOBAR_GTK_H_ |
6 #define CHROME_BROWSER_UI_GTK_INFOBARS_EXTENSION_INFOBAR_GTK_H_ | 6 #define CHROME_BROWSER_UI_GTK_INFOBARS_EXTENSION_INFOBAR_GTK_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "chrome/browser/extensions/extension_infobar_delegate.h" | 9 #include "chrome/browser/extensions/extension_infobar_delegate.h" |
10 #include "chrome/browser/ui/gtk/extensions/extension_view_gtk.h" | 10 #include "chrome/browser/ui/gtk/extensions/extension_view_gtk.h" |
11 #include "chrome/browser/ui/gtk/infobars/infobar_gtk.h" | 11 #include "chrome/browser/ui/gtk/infobars/infobar_gtk.h" |
12 #include "chrome/browser/ui/gtk/menu_gtk.h" | 12 #include "chrome/browser/ui/gtk/menu_gtk.h" |
13 #include "ui/gfx/gtk_util.h" | 13 #include "ui/gfx/gtk_util.h" |
14 | 14 |
15 class ExtensionContextMenuModel; | 15 class ExtensionContextMenuModel; |
16 class ExtensionResource; | 16 class ExtensionResource; |
17 class ExtensionViewGtk; | 17 class ExtensionViewGtk; |
18 class MenuGtk; | 18 class MenuGtk; |
19 | 19 |
20 class ExtensionInfoBarGtk : public InfoBarGtk, | 20 class ExtensionInfoBarGtk : public InfoBarGtk, |
21 public MenuGtk::Delegate { | 21 public MenuGtk::Delegate, |
| 22 public ExtensionInfoBarDelegate::DelegateObserver { |
22 public: | 23 public: |
23 ExtensionInfoBarGtk(InfoBarService* owner, | 24 ExtensionInfoBarGtk(InfoBarService* owner, |
24 ExtensionInfoBarDelegate* delegate); | 25 ExtensionInfoBarDelegate* delegate); |
25 virtual ~ExtensionInfoBarGtk(); | 26 virtual ~ExtensionInfoBarGtk(); |
26 | 27 |
27 // Overridden from InfoBar (through InfoBarGtk): | 28 // Overridden from InfoBar (through InfoBarGtk): |
28 virtual void PlatformSpecificHide(bool animate) OVERRIDE; | 29 virtual void PlatformSpecificHide(bool animate) OVERRIDE; |
29 | 30 |
30 // Overridden from InfoBarGtk: | 31 // Overridden from InfoBarGtk: |
31 virtual void GetTopColor(InfoBarDelegate::Type type, | 32 virtual void GetTopColor(InfoBarDelegate::Type type, |
32 double* r, double* g, double* b) OVERRIDE; | 33 double* r, double* g, double* b) OVERRIDE; |
33 virtual void GetBottomColor(InfoBarDelegate::Type type, | 34 virtual void GetBottomColor(InfoBarDelegate::Type type, |
34 double* r, double* g, double* b) OVERRIDE; | 35 double* r, double* g, double* b) OVERRIDE; |
35 | 36 |
36 // Overridden from MenuGtk::Delegate: | 37 // Overridden from MenuGtk::Delegate: |
37 virtual void StoppedShowing() OVERRIDE; | 38 virtual void StoppedShowing() OVERRIDE; |
38 | 39 |
| 40 // Overridden from ExtensionInfoBarDelegate::DelegateObserver: |
| 41 virtual void OnDelegateDeleted() OVERRIDE; |
| 42 |
39 private: | 43 private: |
40 // Build the widgets of the Infobar. | 44 // Build the widgets of the Infobar. |
41 void BuildWidgets(); | 45 void BuildWidgets(); |
42 | 46 |
43 void OnImageLoaded(const gfx::Image& image); | 47 void OnImageLoaded(const gfx::Image& image); |
44 | 48 |
45 // Looks at the window the infobar is in and gets the browser. Can return | 49 // Looks at the window the infobar is in and gets the browser. Can return |
46 // NULL if we aren't attached. | 50 // NULL if we aren't attached. |
47 Browser* GetBrowser(); | 51 Browser* GetBrowser(); |
48 | 52 |
(...skipping 28 matching lines...) Expand all Loading... |
77 | 81 |
78 // The model for the current menu displayed. | 82 // The model for the current menu displayed. |
79 scoped_refptr<ExtensionContextMenuModel> context_menu_model_; | 83 scoped_refptr<ExtensionContextMenuModel> context_menu_model_; |
80 | 84 |
81 base::WeakPtrFactory<ExtensionInfoBarGtk> weak_ptr_factory_; | 85 base::WeakPtrFactory<ExtensionInfoBarGtk> weak_ptr_factory_; |
82 | 86 |
83 DISALLOW_COPY_AND_ASSIGN(ExtensionInfoBarGtk); | 87 DISALLOW_COPY_AND_ASSIGN(ExtensionInfoBarGtk); |
84 }; | 88 }; |
85 | 89 |
86 #endif // CHROME_BROWSER_UI_GTK_INFOBARS_EXTENSION_INFOBAR_GTK_H_ | 90 #endif // CHROME_BROWSER_UI_GTK_INFOBARS_EXTENSION_INFOBAR_GTK_H_ |
OLD | NEW |