OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <gtk/gtk.h> | 9 #include <gtk/gtk.h> |
10 | 10 |
(...skipping 18 matching lines...) Expand all Loading... |
29 // 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 |
30 // because that's what was easiest when they were split. | 30 // because that's what was easiest when they were split. |
31 explicit TabContentsViewGtk(TabContents* tab_contents); | 31 explicit TabContentsViewGtk(TabContents* tab_contents); |
32 virtual ~TabContentsViewGtk(); | 32 virtual ~TabContentsViewGtk(); |
33 | 33 |
34 // Unlike Windows, ConstrainedWindows need to collaborate with the | 34 // Unlike Windows, ConstrainedWindows need to collaborate with the |
35 // TabContentsViewGtk to position the dialogs. | 35 // TabContentsViewGtk to position the dialogs. |
36 void AttachConstrainedWindow(ConstrainedWindowGtk* constrained_window); | 36 void AttachConstrainedWindow(ConstrainedWindowGtk* constrained_window); |
37 void RemoveConstrainedWindow(ConstrainedWindowGtk* constrained_window); | 37 void RemoveConstrainedWindow(ConstrainedWindowGtk* constrained_window); |
38 | 38 |
| 39 // Override the stored focus widget. This call only makes sense when the |
| 40 // tab contents is not focused. |
| 41 void SetFocusedWidget(GtkWidget* widget); |
| 42 |
39 // TabContentsView implementation -------------------------------------------- | 43 // TabContentsView implementation -------------------------------------------- |
40 | 44 |
41 virtual void CreateView(const gfx::Size& initial_size); | 45 virtual void CreateView(const gfx::Size& initial_size); |
42 virtual RenderWidgetHostView* CreateViewForWidget( | 46 virtual RenderWidgetHostView* CreateViewForWidget( |
43 RenderWidgetHost* render_widget_host); | 47 RenderWidgetHost* render_widget_host); |
44 | 48 |
45 virtual gfx::NativeView GetNativeView() const; | 49 virtual gfx::NativeView GetNativeView() const; |
46 virtual gfx::NativeView GetContentNativeView() const; | 50 virtual gfx::NativeView GetContentNativeView() const; |
47 virtual gfx::NativeWindow GetTopLevelNativeWindow() const; | 51 virtual gfx::NativeWindow GetTopLevelNativeWindow() const; |
48 virtual void GetContainerBounds(gfx::Rect* out) const; | 52 virtual void GetContainerBounds(gfx::Rect* out) const; |
(...skipping 23 matching lines...) Expand all Loading... |
72 | 76 |
73 private: | 77 private: |
74 // Insert the given widget into the content area. Should only be used for | 78 // Insert the given widget into the content area. Should only be used for |
75 // web pages and the like (including interstitials and sad tab). Note that | 79 // web pages and the like (including interstitials and sad tab). Note that |
76 // this will be perfectly happy to insert overlapping render views, so care | 80 // this will be perfectly happy to insert overlapping render views, so care |
77 // should be taken that the correct one is hidden/shown. | 81 // should be taken that the correct one is hidden/shown. |
78 void InsertIntoContentArea(GtkWidget* widget); | 82 void InsertIntoContentArea(GtkWidget* widget); |
79 | 83 |
80 void CancelDragIfAny(); | 84 void CancelDragIfAny(); |
81 | 85 |
| 86 // Handle focus traversal on the render widget native view. |
| 87 CHROMEGTK_CALLBACK_1(TabContentsViewGtk, gboolean, OnFocus, GtkDirectionType); |
| 88 |
82 // We keep track of the timestamp of the latest mousedown event. | 89 // We keep track of the timestamp of the latest mousedown event. |
83 CHROMEGTK_CALLBACK_1(TabContentsViewGtk, gboolean, OnMouseDown, | 90 CHROMEGTK_CALLBACK_1(TabContentsViewGtk, gboolean, OnMouseDown, |
84 GdkEventButton*); | 91 GdkEventButton*); |
85 | 92 |
86 // Used to adjust the size of its children when the size of |expanded_| is | 93 // Used to adjust the size of its children when the size of |expanded_| is |
87 // changed. | 94 // changed. |
88 CHROMEGTK_CALLBACK_2(TabContentsViewGtk, void, OnChildSizeRequest, | 95 CHROMEGTK_CALLBACK_2(TabContentsViewGtk, void, OnChildSizeRequest, |
89 GtkWidget*, GtkRequisition*); | 96 GtkWidget*, GtkRequisition*); |
90 | 97 |
91 // Used to propagate the size change of |expanded_| to our RWHV to resize the | 98 // Used to propagate the size change of |expanded_| to our RWHV to resize the |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 scoped_ptr<TabContentsDragSource> drag_source_; | 137 scoped_ptr<TabContentsDragSource> drag_source_; |
131 | 138 |
132 // The size we want the tab contents view to be. We keep this in a separate | 139 // The size we want the tab contents view to be. We keep this in a separate |
133 // variable because resizing in GTK+ is async. | 140 // variable because resizing in GTK+ is async. |
134 gfx::Size requested_size_; | 141 gfx::Size requested_size_; |
135 | 142 |
136 DISALLOW_COPY_AND_ASSIGN(TabContentsViewGtk); | 143 DISALLOW_COPY_AND_ASSIGN(TabContentsViewGtk); |
137 }; | 144 }; |
138 | 145 |
139 #endif // CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_VIEW_GTK_H_ | 146 #endif // CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_VIEW_GTK_H_ |
OLD | NEW |