| OLD | NEW |
| 1 // Copyright (c) 2011 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_INFOBAR_GTK_H_ | 5 #ifndef CHROME_BROWSER_UI_GTK_INFOBARS_INFOBAR_GTK_H_ |
| 6 #define CHROME_BROWSER_UI_GTK_INFOBARS_INFOBAR_GTK_H_ | 6 #define CHROME_BROWSER_UI_GTK_INFOBARS_INFOBAR_GTK_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <gtk/gtk.h> | 9 #include <gtk/gtk.h> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "chrome/browser/infobars/infobar.h" | 13 #include "chrome/browser/infobars/infobar.h" |
| 14 #include "chrome/browser/infobars/infobar_delegate.h" | 14 #include "chrome/browser/infobars/infobar_delegate.h" |
| 15 #include "chrome/browser/ui/gtk/menu_gtk.h" | 15 #include "chrome/browser/ui/gtk/menu_gtk.h" |
| 16 #include "content/public/browser/notification_observer.h" | 16 #include "content/public/browser/notification_observer.h" |
| 17 #include "content/public/browser/notification_registrar.h" | 17 #include "content/public/browser/notification_registrar.h" |
| 18 #include "third_party/skia/include/core/SkColor.h" | 18 #include "third_party/skia/include/core/SkColor.h" |
| 19 #include "ui/base/gtk/gtk_signal.h" | 19 #include "ui/base/gtk/gtk_signal.h" |
| 20 #include "ui/base/gtk/owned_widget_gtk.h" | 20 #include "ui/base/gtk/owned_widget_gtk.h" |
| 21 | 21 |
| 22 class CustomDrawButton; | 22 class CustomDrawButton; |
| 23 class GtkThemeService; | 23 class ThemeServiceGtk; |
| 24 | 24 |
| 25 namespace ui { | 25 namespace ui { |
| 26 class GtkSignalRegistrar; | 26 class GtkSignalRegistrar; |
| 27 class MenuModel; | 27 class MenuModel; |
| 28 } | 28 } |
| 29 | 29 |
| 30 class InfoBarGtk : public InfoBar, | 30 class InfoBarGtk : public InfoBar, |
| 31 public content::NotificationObserver { | 31 public content::NotificationObserver { |
| 32 public: | 32 public: |
| 33 InfoBarGtk(InfoBarTabHelper* owner, InfoBarDelegate* delegate); | 33 InfoBarGtk(InfoBarTabHelper* owner, InfoBarDelegate* delegate); |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 // The second highest widget in the hierarchy (after the |widget_|). | 99 // The second highest widget in the hierarchy (after the |widget_|). |
| 100 GtkWidget* bg_box_; | 100 GtkWidget* bg_box_; |
| 101 | 101 |
| 102 // The hbox that holds infobar elements (button, text, icon, etc.). | 102 // The hbox that holds infobar elements (button, text, icon, etc.). |
| 103 GtkWidget* hbox_; | 103 GtkWidget* hbox_; |
| 104 | 104 |
| 105 // The x that closes the bar. | 105 // The x that closes the bar. |
| 106 scoped_ptr<CustomDrawButton> close_button_; | 106 scoped_ptr<CustomDrawButton> close_button_; |
| 107 | 107 |
| 108 // The theme provider, used for getting border colors. | 108 // The theme provider, used for getting border colors. |
| 109 GtkThemeService* theme_service_; | 109 ThemeServiceGtk* theme_service_; |
| 110 | 110 |
| 111 content::NotificationRegistrar registrar_; | 111 content::NotificationRegistrar registrar_; |
| 112 | 112 |
| 113 private: | 113 private: |
| 114 CHROMEGTK_CALLBACK_0(InfoBarGtk, void, OnCloseButton); | 114 CHROMEGTK_CALLBACK_0(InfoBarGtk, void, OnCloseButton); |
| 115 CHROMEGTK_CALLBACK_1(InfoBarGtk, gboolean, OnBackgroundExpose, | 115 CHROMEGTK_CALLBACK_1(InfoBarGtk, gboolean, OnBackgroundExpose, |
| 116 GdkEventExpose*); | 116 GdkEventExpose*); |
| 117 | 117 |
| 118 CHROMEGTK_CALLBACK_2(InfoBarGtk, void, OnChildSizeRequest, GtkWidget*, | 118 CHROMEGTK_CALLBACK_2(InfoBarGtk, void, OnChildSizeRequest, GtkWidget*, |
| 119 GtkRequisition*); | 119 GtkRequisition*); |
| 120 | 120 |
| 121 void UpdateBorderColor(); | 121 void UpdateBorderColor(); |
| 122 | 122 |
| 123 // A GtkExpandedContainer that contains |bg_box_| so we can varry the height | 123 // A GtkExpandedContainer that contains |bg_box_| so we can varry the height |
| 124 // of the infobar. | 124 // of the infobar. |
| 125 ui::OwnedWidgetGtk widget_; | 125 ui::OwnedWidgetGtk widget_; |
| 126 | 126 |
| 127 // A list of signals which we clear out once we're closing. | 127 // A list of signals which we clear out once we're closing. |
| 128 scoped_ptr<ui::GtkSignalRegistrar> signals_; | 128 scoped_ptr<ui::GtkSignalRegistrar> signals_; |
| 129 | 129 |
| 130 // The current menu displayed. Can be null. We own this on the base class so | 130 // The current menu displayed. Can be null. We own this on the base class so |
| 131 // we can cancel the menu while we're closing. | 131 // we can cancel the menu while we're closing. |
| 132 scoped_ptr<ui::MenuModel> menu_model_; | 132 scoped_ptr<ui::MenuModel> menu_model_; |
| 133 scoped_ptr<MenuGtk> menu_; | 133 scoped_ptr<MenuGtk> menu_; |
| 134 | 134 |
| 135 DISALLOW_COPY_AND_ASSIGN(InfoBarGtk); | 135 DISALLOW_COPY_AND_ASSIGN(InfoBarGtk); |
| 136 }; | 136 }; |
| 137 | 137 |
| 138 #endif // CHROME_BROWSER_UI_GTK_INFOBARS_INFOBAR_GTK_H_ | 138 #endif // CHROME_BROWSER_UI_GTK_INFOBARS_INFOBAR_GTK_H_ |
| OLD | NEW |