| 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> | 10 #include <vector> |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 // this will be perfectly happy to insert overlapping render views, so care | 82 // this will be perfectly happy to insert overlapping render views, so care |
| 83 // should be taken that the correct one is hidden/shown. | 83 // should be taken that the correct one is hidden/shown. |
| 84 void InsertIntoContentArea(GtkWidget* widget); | 84 void InsertIntoContentArea(GtkWidget* widget); |
| 85 | 85 |
| 86 void CancelDragIfAny(); | 86 void CancelDragIfAny(); |
| 87 | 87 |
| 88 // We keep track of the timestamp of the latest mousedown event. | 88 // We keep track of the timestamp of the latest mousedown event. |
| 89 static gboolean OnMouseDown(GtkWidget* widget, | 89 static gboolean OnMouseDown(GtkWidget* widget, |
| 90 GdkEventButton* event, TabContentsViewGtk* view); | 90 GdkEventButton* event, TabContentsViewGtk* view); |
| 91 | 91 |
| 92 // Used to propagate size changes on |fixed_| to its children. | 92 // Used to adjust the size of its children when the size of |expanded_| is |
| 93 static gboolean OnSizeAllocate(GtkWidget* widget, | 93 // changed. |
| 94 GtkAllocation* config, | 94 static void OnChildSizeRequest(GtkWidget* widget, |
| 95 GtkWidget* child, |
| 96 GtkRequisition* requisition, |
| 95 TabContentsViewGtk* view); | 97 TabContentsViewGtk* view); |
| 96 | 98 |
| 99 // Used to propagate the size change of |expanded_| to our RWHV to resize the |
| 100 // renderer content. |
| 101 static void OnSizeAllocate(GtkWidget* widget, |
| 102 GtkAllocation* allocation, |
| 103 TabContentsViewGtk* view); |
| 104 |
| 97 static void OnSetFloatingPosition( | 105 static void OnSetFloatingPosition( |
| 98 GtkFloatingContainer* floating_container, GtkAllocation* allocation, | 106 GtkFloatingContainer* floating_container, GtkAllocation* allocation, |
| 99 TabContentsViewGtk* tab_contents_view); | 107 TabContentsViewGtk* tab_contents_view); |
| 100 | 108 |
| 101 // Contains |fixed_| as its GtkBin member and a possible floating widget from | 109 // Contains |expanded_| as its GtkBin member and a possible floating widget |
| 102 // |popup_view_|. | 110 // from |popup_view_|. |
| 103 OwnedWidgetGtk floating_; | 111 OwnedWidgetGtk floating_; |
| 104 | 112 |
| 105 // This container holds the tab's web page views. It is a GtkFixed so that we | 113 // This container holds the tab's web page views. It is a GtkExpandedContainer |
| 106 // can control the size of the web pages. | 114 // so that we can control the size of the web pages. |
| 107 GtkWidget* fixed_; | 115 GtkWidget* expanded_; |
| 108 | 116 |
| 109 // The context menu is reset every time we show it, but we keep a pointer to | 117 // The context menu is reset every time we show it, but we keep a pointer to |
| 110 // between uses so that it won't go out of scope before we're done with it. | 118 // between uses so that it won't go out of scope before we're done with it. |
| 111 scoped_ptr<RenderViewContextMenuGtk> context_menu_; | 119 scoped_ptr<RenderViewContextMenuGtk> context_menu_; |
| 112 | 120 |
| 113 // The event for the last mouse down we handled. We need this for context | 121 // The event for the last mouse down we handled. We need this for context |
| 114 // menus and drags. | 122 // menus and drags. |
| 115 GdkEventButton last_mouse_down_; | 123 GdkEventButton last_mouse_down_; |
| 116 | 124 |
| 117 // Used to get notifications about renderers coming and going. | 125 // Used to get notifications about renderers coming and going. |
| (...skipping 19 matching lines...) Expand all Loading... |
| 137 scoped_ptr<TabContentsDragSource> drag_source_; | 145 scoped_ptr<TabContentsDragSource> drag_source_; |
| 138 | 146 |
| 139 // The size we want the tab contents view to be. We keep this in a separate | 147 // The size we want the tab contents view to be. We keep this in a separate |
| 140 // variable because resizing in GTK+ is async. | 148 // variable because resizing in GTK+ is async. |
| 141 gfx::Size requested_size_; | 149 gfx::Size requested_size_; |
| 142 | 150 |
| 143 DISALLOW_COPY_AND_ASSIGN(TabContentsViewGtk); | 151 DISALLOW_COPY_AND_ASSIGN(TabContentsViewGtk); |
| 144 }; | 152 }; |
| 145 | 153 |
| 146 #endif // CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_VIEW_GTK_H_ | 154 #endif // CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_VIEW_GTK_H_ |
| OLD | NEW |