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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "chrome/browser/extensions/extension_infobar_delegate.h" | 9 #include "chrome/browser/extensions/extension_infobar_delegate.h" |
10 #include "chrome/browser/extensions/image_loading_tracker.h" | 10 #include "chrome/browser/extensions/image_loading_tracker.h" |
11 #include "chrome/browser/ui/gtk/extensions/extension_view_gtk.h" | 11 #include "chrome/browser/ui/gtk/extensions/extension_view_gtk.h" |
12 #include "chrome/browser/ui/gtk/infobars/infobar_gtk.h" | 12 #include "chrome/browser/ui/gtk/infobars/infobar_gtk.h" |
13 #include "ui/gfx/gtk_util.h" | 13 #include "ui/gfx/gtk_util.h" |
14 | 14 |
15 class ExtensionInfobarDelegate; | 15 class ExtensionInfobarDelegate; |
16 class ExtensionResource; | 16 class ExtensionResource; |
17 class ExtensionViewGtk; | 17 class ExtensionViewGtk; |
18 | 18 |
19 class ExtensionInfoBarGtk : public InfoBarGtk, | 19 class ExtensionInfoBarGtk : public InfoBarGtk, |
20 public ImageLoadingTracker::Observer, | 20 public ImageLoadingTracker::Observer, |
21 public ExtensionViewGtk::Container { | 21 public ExtensionViewGtk::Container { |
22 public: | 22 public: |
23 explicit ExtensionInfoBarGtk(TabContentsWrapper* owner, | 23 ExtensionInfoBarGtk(TabContentsWrapper* owner, |
24 ExtensionInfoBarDelegate* delegate); | 24 ExtensionInfoBarDelegate* delegate); |
25 virtual ~ExtensionInfoBarGtk(); | 25 virtual ~ExtensionInfoBarGtk(); |
26 | 26 |
27 // Overridden from ImageLoadingTracker::Observer: | 27 // Overridden from ImageLoadingTracker::Observer: |
28 virtual void OnImageLoaded( | 28 virtual void OnImageLoaded( |
29 SkBitmap* image, const ExtensionResource& resource, int index); | 29 SkBitmap* image, const ExtensionResource& resource, int index); |
30 | 30 |
31 // ExtensionViewGtk::Container implementation | 31 // ExtensionViewGtk::Container implementation |
32 virtual void OnExtensionPreferredSizeChanged(ExtensionViewGtk* view, | 32 virtual void OnExtensionPreferredSizeChanged(ExtensionViewGtk* view, |
33 const gfx::Size& new_size); | 33 const gfx::Size& new_size); |
34 | 34 |
35 private: | 35 private: |
36 // Build the widgets of the Infobar. | 36 // Build the widgets of the Infobar. |
37 void BuildWidgets(); | 37 void BuildWidgets(); |
38 | 38 |
39 CHROMEGTK_CALLBACK_1(ExtensionInfoBarGtk, void, OnSizeAllocate, | 39 CHROMEGTK_CALLBACK_1(ExtensionInfoBarGtk, void, OnSizeAllocate, |
40 GtkAllocation*); | 40 GtkAllocation*); |
41 | 41 |
42 ImageLoadingTracker tracker_; | 42 ImageLoadingTracker tracker_; |
43 | 43 |
44 ExtensionInfoBarDelegate* delegate_; | 44 ExtensionInfoBarDelegate* delegate_; |
45 | 45 |
46 ExtensionViewGtk* view_; | 46 ExtensionViewGtk* view_; |
47 | 47 |
48 DISALLOW_COPY_AND_ASSIGN(ExtensionInfoBarGtk); | 48 DISALLOW_COPY_AND_ASSIGN(ExtensionInfoBarGtk); |
49 }; | 49 }; |
50 | 50 |
51 #endif // CHROME_BROWSER_UI_GTK_INFOBARS_EXTENSION_INFOBAR_GTK_H_ | 51 #endif // CHROME_BROWSER_UI_GTK_INFOBARS_EXTENSION_INFOBAR_GTK_H_ |
OLD | NEW |