| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_TAB_CONTENTS_TAB_CONTENTS_VIEW_GTK_H_ | 5 #ifndef CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_VIEW_GTK_H_ |
| 6 #define CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_VIEW_GTK_H_ | 6 #define CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_VIEW_GTK_H_ |
| 7 | 7 |
| 8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
| 9 | 9 |
| 10 #include <vector> |
| 11 |
| 10 #include "base/scoped_ptr.h" | 12 #include "base/scoped_ptr.h" |
| 11 #include "chrome/browser/gtk/focus_store_gtk.h" | 13 #include "chrome/browser/gtk/focus_store_gtk.h" |
| 12 #include "chrome/browser/tab_contents/tab_contents_view.h" | 14 #include "chrome/browser/tab_contents/tab_contents_view.h" |
| 13 #include "chrome/common/notification_observer.h" | 15 #include "chrome/common/notification_observer.h" |
| 14 #include "chrome/common/notification_registrar.h" | 16 #include "chrome/common/notification_registrar.h" |
| 15 #include "chrome/common/owned_widget_gtk.h" | 17 #include "chrome/common/owned_widget_gtk.h" |
| 16 | 18 |
| 17 class BlockedPopupContainerViewGtk; | 19 class BlockedPopupContainerViewGtk; |
| 20 class ConstrainedWindowGtk; |
| 18 class RenderViewContextMenuGtk; | 21 class RenderViewContextMenuGtk; |
| 19 class SadTabGtk; | 22 class SadTabGtk; |
| 20 typedef struct _GtkFloatingContainer GtkFloatingContainer; | 23 typedef struct _GtkFloatingContainer GtkFloatingContainer; |
| 21 | 24 |
| 22 class TabContentsViewGtk : public TabContentsView, | 25 class TabContentsViewGtk : public TabContentsView, |
| 23 public NotificationObserver { | 26 public NotificationObserver { |
| 24 public: | 27 public: |
| 25 // The corresponding TabContents is passed in the constructor, and manages our | 28 // The corresponding TabContents is passed in the constructor, and manages our |
| 26 // lifetime. This doesn't need to be the case, but is this way currently | 29 // lifetime. This doesn't need to be the case, but is this way currently |
| 27 // because that's what was easiest when they were split. | 30 // because that's what was easiest when they were split. |
| 28 explicit TabContentsViewGtk(TabContents* tab_contents); | 31 explicit TabContentsViewGtk(TabContents* tab_contents); |
| 29 virtual ~TabContentsViewGtk(); | 32 virtual ~TabContentsViewGtk(); |
| 30 | 33 |
| 31 // Unlike Windows, the BlockedPopupContainerView needs to collaborate with | 34 // Unlike Windows, the BlockedPopupContainerView needs to collaborate with |
| 32 // the TabContentsViewGtk to position the notification. | 35 // the TabContentsViewGtk to position the notification. |
| 33 void AttachBlockedPopupView(BlockedPopupContainerViewGtk* popup_view); | 36 void AttachBlockedPopupView(BlockedPopupContainerViewGtk* popup_view); |
| 34 void RemoveBlockedPopupView(BlockedPopupContainerViewGtk* popup_view); | 37 void RemoveBlockedPopupView(BlockedPopupContainerViewGtk* popup_view); |
| 35 | 38 |
| 39 // Unlike Windows, ConstrainedWindows need to collaborate with the |
| 40 // TabContentsViewGtk to position the dialogs. |
| 41 void AttachConstrainedWindow(ConstrainedWindowGtk* constrained_window); |
| 42 void RemoveConstrainedWindow(ConstrainedWindowGtk* constrained_window); |
| 43 |
| 36 // TabContentsView implementation -------------------------------------------- | 44 // TabContentsView implementation -------------------------------------------- |
| 37 | 45 |
| 38 virtual void CreateView(); | 46 virtual void CreateView(); |
| 39 virtual RenderWidgetHostView* CreateViewForWidget( | 47 virtual RenderWidgetHostView* CreateViewForWidget( |
| 40 RenderWidgetHost* render_widget_host); | 48 RenderWidgetHost* render_widget_host); |
| 41 | 49 |
| 42 virtual gfx::NativeView GetNativeView() const; | 50 virtual gfx::NativeView GetNativeView() const; |
| 43 virtual gfx::NativeView GetContentNativeView() const; | 51 virtual gfx::NativeView GetContentNativeView() const; |
| 44 virtual gfx::NativeWindow GetTopLevelNativeWindow() const; | 52 virtual gfx::NativeWindow GetTopLevelNativeWindow() const; |
| 45 virtual void GetContainerBounds(gfx::Rect* out) const; | 53 virtual void GetContainerBounds(gfx::Rect* out) const; |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 // show context menus. | 110 // show context menus. |
| 103 guint32 last_mouse_down_time_; | 111 guint32 last_mouse_down_time_; |
| 104 | 112 |
| 105 // Used to get notifications about renderers coming and going. | 113 // Used to get notifications about renderers coming and going. |
| 106 NotificationRegistrar registrar_; | 114 NotificationRegistrar registrar_; |
| 107 | 115 |
| 108 scoped_ptr<SadTabGtk> sad_tab_; | 116 scoped_ptr<SadTabGtk> sad_tab_; |
| 109 | 117 |
| 110 FocusStoreGtk focus_store_; | 118 FocusStoreGtk focus_store_; |
| 111 | 119 |
| 120 // Our UI for controlling popups (or NULL if no popup windows have been |
| 121 // opened). |popup_view_| is owned by the TabContents, not the view. |
| 112 BlockedPopupContainerViewGtk* popup_view_; | 122 BlockedPopupContainerViewGtk* popup_view_; |
| 113 | 123 |
| 124 // Each individual UI for constrained dialogs currently displayed. The |
| 125 // objects in this vector are owned by the TabContents, not the view. |
| 126 std::vector<ConstrainedWindowGtk*> constrained_windows_; |
| 127 |
| 114 DISALLOW_COPY_AND_ASSIGN(TabContentsViewGtk); | 128 DISALLOW_COPY_AND_ASSIGN(TabContentsViewGtk); |
| 115 }; | 129 }; |
| 116 | 130 |
| 117 #endif // CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_VIEW_GTK_H_ | 131 #endif // CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_VIEW_GTK_H_ |
| OLD | NEW |