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 { | |
22 public: | 21 public: |
23 ExtensionInfoBarGtk(TabContentsWrapper* owner, | 22 ExtensionInfoBarGtk(TabContentsWrapper* owner, |
24 ExtensionInfoBarDelegate* delegate); | 23 ExtensionInfoBarDelegate* delegate); |
25 virtual ~ExtensionInfoBarGtk(); | 24 virtual ~ExtensionInfoBarGtk(); |
26 | 25 |
27 // Overridden from ImageLoadingTracker::Observer: | 26 // Overridden from ImageLoadingTracker::Observer: |
28 virtual void OnImageLoaded( | 27 virtual void OnImageLoaded( |
29 SkBitmap* image, const ExtensionResource& resource, int index); | 28 SkBitmap* image, const ExtensionResource& resource, int index); |
30 | 29 |
31 // ExtensionViewGtk::Container implementation | |
32 virtual void OnExtensionPreferredSizeChanged(ExtensionViewGtk* view, | |
33 const gfx::Size& new_size); | |
34 | |
35 private: | 30 private: |
36 // Build the widgets of the Infobar. | 31 // Build the widgets of the Infobar. |
37 void BuildWidgets(); | 32 void BuildWidgets(); |
38 | 33 |
39 CHROMEGTK_CALLBACK_1(ExtensionInfoBarGtk, void, OnSizeAllocate, | 34 CHROMEGTK_CALLBACK_1(ExtensionInfoBarGtk, void, OnSizeAllocate, |
40 GtkAllocation*); | 35 GtkAllocation*); |
41 | 36 |
42 ImageLoadingTracker tracker_; | 37 ImageLoadingTracker tracker_; |
43 | 38 |
44 ExtensionInfoBarDelegate* delegate_; | 39 ExtensionInfoBarDelegate* delegate_; |
45 | 40 |
46 ExtensionViewGtk* view_; | 41 ExtensionViewGtk* view_; |
47 | 42 |
48 DISALLOW_COPY_AND_ASSIGN(ExtensionInfoBarGtk); | 43 DISALLOW_COPY_AND_ASSIGN(ExtensionInfoBarGtk); |
49 }; | 44 }; |
50 | 45 |
51 #endif // CHROME_BROWSER_UI_GTK_INFOBARS_EXTENSION_INFOBAR_GTK_H_ | 46 #endif // CHROME_BROWSER_UI_GTK_INFOBARS_EXTENSION_INFOBAR_GTK_H_ |
OLD | NEW |