OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_UI_VIEWS_TAB_CONTENTS_NATIVE_TAB_CONTENTS_VIEW_GTK_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_TAB_CONTENTS_NATIVE_TAB_CONTENTS_VIEW_GTK_H_ |
| 7 #pragma once |
| 8 |
| 9 #include "chrome/browser/ui/views/tab_contents/native_tab_contents_view.h" |
| 10 #include "views/widget/widget_gtk.h" |
| 11 |
| 12 class ConstrainedWindowGtk; |
| 13 class TabContents; |
| 14 class TabContentsDragSource; |
| 15 class WebDragDestGtk; |
| 16 |
| 17 class NativeTabContentsViewGtk : public views::WidgetGtk, |
| 18 public NativeTabContentsView { |
| 19 public: |
| 20 explicit NativeTabContentsViewGtk( |
| 21 internal::NativeTabContentsViewDelegate* delegate); |
| 22 virtual ~NativeTabContentsViewGtk(); |
| 23 |
| 24 // Unlike Windows, ConstrainedWindows need to collaborate with the |
| 25 // TabContentsViewGtk to position the dialogs. |
| 26 void AttachConstrainedWindow(ConstrainedWindowGtk* constrained_window); |
| 27 void RemoveConstrainedWindow(ConstrainedWindowGtk* constrained_window); |
| 28 |
| 29 |
| 30 private: |
| 31 // Overridden from NativeTabContentsView: |
| 32 virtual void InitNativeTabContentsView() OVERRIDE; |
| 33 virtual void Unparent() OVERRIDE; |
| 34 virtual RenderWidgetHostView* CreateRenderWidgetHostView( |
| 35 RenderWidgetHost* render_widget_host) OVERRIDE; |
| 36 virtual gfx::NativeWindow GetTopLevelNativeWindow() const OVERRIDE; |
| 37 virtual void SetPageTitle(const std::wstring& title) OVERRIDE; |
| 38 virtual void StartDragging(const WebDropData& drop_data, |
| 39 WebKit::WebDragOperationsMask ops, |
| 40 const SkBitmap& image, |
| 41 const gfx::Point& image_offset) OVERRIDE; |
| 42 virtual void CancelDrag() OVERRIDE; |
| 43 virtual bool IsDoingDrag() const OVERRIDE; |
| 44 virtual void SetDragCursor(WebKit::WebDragOperation operation) OVERRIDE; |
| 45 virtual views::NativeWidget* AsNativeWidget() OVERRIDE; |
| 46 |
| 47 // Overridden from views::WidgetGtk: |
| 48 virtual gboolean OnMotionNotify(GtkWidget* widget, |
| 49 GdkEventMotion* event) OVERRIDE; |
| 50 virtual gboolean OnLeaveNotify(GtkWidget* widget, |
| 51 GdkEventCrossing* event) OVERRIDE; |
| 52 virtual gboolean OnButtonPress(GtkWidget* widget, |
| 53 GdkEventButton* event) OVERRIDE; |
| 54 virtual void OnSizeAllocate(GtkWidget* widget, |
| 55 GtkAllocation* allocation) OVERRIDE; |
| 56 virtual void OnShow(GtkWidget* widget) OVERRIDE; |
| 57 virtual void OnHide(GtkWidget* widget) OVERRIDE; |
| 58 |
| 59 void PositionConstrainedWindows(const gfx::Size& view_size); |
| 60 |
| 61 internal::NativeTabContentsViewDelegate* delegate_; |
| 62 |
| 63 // Whether to ignore the next CHAR keyboard event. |
| 64 bool ignore_next_char_event_; |
| 65 |
| 66 // Handles drags from this TabContentsView. |
| 67 scoped_ptr<TabContentsDragSource> drag_source_; |
| 68 |
| 69 // The event for the last mouse down we handled. We need this for drags. |
| 70 GdkEventButton last_mouse_down_; |
| 71 |
| 72 // The helper object that handles drag destination related interactions with |
| 73 // GTK. |
| 74 scoped_ptr<WebDragDestGtk> drag_dest_; |
| 75 |
| 76 // Current size. See comment in WidgetGtk as to why this is cached. |
| 77 gfx::Size size_; |
| 78 |
| 79 // Each individual UI for constrained dialogs currently displayed. The |
| 80 // objects in this vector are owned by the TabContents, not the view. |
| 81 std::vector<ConstrainedWindowGtk*> constrained_windows_; |
| 82 |
| 83 DISALLOW_COPY_AND_ASSIGN(NativeTabContentsViewGtk); |
| 84 }; |
| 85 |
| 86 #endif // CHROME_BROWSER_UI_VIEWS_TAB_CONTENTS_NATIVE_TAB_CONTENTS_VIEW_GTK_H_ |
| 87 |
| 88 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 89 // Use of this source code is governed by a BSD-style license that can be |
| 90 // found in the LICENSE file. |
| 91 |
| 92 #ifndef CHROME_BROWSER_UI_VIEWS_TAB_CONTENTS_NATIVE_TAB_CONTENTS_VIEW_GTK_H_ |
| 93 #define CHROME_BROWSER_UI_VIEWS_TAB_CONTENTS_NATIVE_TAB_CONTENTS_VIEW_GTK_H_ |
| 94 #pragma once |
| 95 |
| 96 #include "chrome/browser/ui/views/tab_contents/native_tab_contents_view.h" |
| 97 #include "views/widget/widget_gtk.h" |
| 98 |
| 99 class ConstrainedWindowGtk; |
| 100 class TabContents; |
| 101 class TabContentsDragSource; |
| 102 class WebDragDestGtk; |
| 103 |
| 104 class NativeTabContentsViewGtk : public views::WidgetGtk, |
| 105 public NativeTabContentsView { |
| 106 public: |
| 107 explicit NativeTabContentsViewGtk( |
| 108 internal::NativeTabContentsViewDelegate* delegate); |
| 109 virtual ~NativeTabContentsViewGtk(); |
| 110 |
| 111 // Unlike Windows, ConstrainedWindows need to collaborate with the |
| 112 // TabContentsViewGtk to position the dialogs. |
| 113 void AttachConstrainedWindow(ConstrainedWindowGtk* constrained_window); |
| 114 void RemoveConstrainedWindow(ConstrainedWindowGtk* constrained_window); |
| 115 |
| 116 |
| 117 private: |
| 118 // Overridden from NativeTabContentsView: |
| 119 virtual void InitNativeTabContentsView() OVERRIDE; |
| 120 virtual void Unparent() OVERRIDE; |
| 121 virtual RenderWidgetHostView* CreateRenderWidgetHostView( |
| 122 RenderWidgetHost* render_widget_host) OVERRIDE; |
| 123 virtual gfx::NativeWindow GetTopLevelNativeWindow() const OVERRIDE; |
| 124 virtual void SetPageTitle(const std::wstring& title) OVERRIDE; |
| 125 virtual void StartDragging(const WebDropData& drop_data, |
| 126 WebKit::WebDragOperationsMask ops, |
| 127 const SkBitmap& image, |
| 128 const gfx::Point& image_offset) OVERRIDE; |
| 129 virtual void CancelDrag() OVERRIDE; |
| 130 virtual bool IsDoingDrag() const OVERRIDE; |
| 131 virtual void SetDragCursor(WebKit::WebDragOperation operation) OVERRIDE; |
| 132 virtual views::NativeWidget* AsNativeWidget() OVERRIDE; |
| 133 |
| 134 // Overridden from views::WidgetGtk: |
| 135 virtual gboolean OnMotionNotify(GtkWidget* widget, |
| 136 GdkEventMotion* event) OVERRIDE; |
| 137 virtual gboolean OnLeaveNotify(GtkWidget* widget, |
| 138 GdkEventCrossing* event) OVERRIDE; |
| 139 virtual gboolean OnButtonPress(GtkWidget* widget, |
| 140 GdkEventButton* event) OVERRIDE; |
| 141 virtual void OnSizeAllocate(GtkWidget* widget, |
| 142 GtkAllocation* allocation) OVERRIDE; |
| 143 virtual void OnShow(GtkWidget* widget) OVERRIDE; |
| 144 virtual void OnHide(GtkWidget* widget) OVERRIDE; |
| 145 |
| 146 void PositionConstrainedWindows(const gfx::Size& view_size); |
| 147 |
| 148 internal::NativeTabContentsViewDelegate* delegate_; |
| 149 |
| 150 // Whether to ignore the next CHAR keyboard event. |
| 151 bool ignore_next_char_event_; |
| 152 |
| 153 // Handles drags from this TabContentsView. |
| 154 scoped_ptr<TabContentsDragSource> drag_source_; |
| 155 |
| 156 // The event for the last mouse down we handled. We need this for drags. |
| 157 GdkEventButton last_mouse_down_; |
| 158 |
| 159 // The helper object that handles drag destination related interactions with |
| 160 // GTK. |
| 161 scoped_ptr<WebDragDestGtk> drag_dest_; |
| 162 |
| 163 // Current size. See comment in WidgetGtk as to why this is cached. |
| 164 gfx::Size size_; |
| 165 |
| 166 // Each individual UI for constrained dialogs currently displayed. The |
| 167 // objects in this vector are owned by the TabContents, not the view. |
| 168 std::vector<ConstrainedWindowGtk*> constrained_windows_; |
| 169 |
| 170 DISALLOW_COPY_AND_ASSIGN(NativeTabContentsViewGtk); |
| 171 }; |
| 172 |
| 173 #endif // CHROME_BROWSER_UI_VIEWS_TAB_CONTENTS_NATIVE_TAB_CONTENTS_VIEW_GTK_H_ |
| 174 |
| 175 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 176 // Use of this source code is governed by a BSD-style license that can be |
| 177 // found in the LICENSE file. |
| 178 |
| 179 #ifndef CHROME_BROWSER_UI_VIEWS_TAB_CONTENTS_NATIVE_TAB_CONTENTS_VIEW_GTK_H_ |
| 180 #define CHROME_BROWSER_UI_VIEWS_TAB_CONTENTS_NATIVE_TAB_CONTENTS_VIEW_GTK_H_ |
| 181 #pragma once |
| 182 |
| 183 #include "chrome/browser/ui/views/tab_contents/native_tab_contents_view.h" |
| 184 #include "views/widget/widget_gtk.h" |
| 185 |
| 186 class ConstrainedWindowGtk; |
| 187 class TabContents; |
| 188 class TabContentsDragSource; |
| 189 class WebDragDestGtk; |
| 190 |
| 191 class NativeTabContentsViewGtk : public views::WidgetGtk, |
| 192 public NativeTabContentsView { |
| 193 public: |
| 194 explicit NativeTabContentsViewGtk( |
| 195 internal::NativeTabContentsViewDelegate* delegate); |
| 196 virtual ~NativeTabContentsViewGtk(); |
| 197 |
| 198 // Unlike Windows, ConstrainedWindows need to collaborate with the |
| 199 // TabContentsViewGtk to position the dialogs. |
| 200 void AttachConstrainedWindow(ConstrainedWindowGtk* constrained_window); |
| 201 void RemoveConstrainedWindow(ConstrainedWindowGtk* constrained_window); |
| 202 |
| 203 |
| 204 private: |
| 205 // Overridden from NativeTabContentsView: |
| 206 virtual void InitNativeTabContentsView() OVERRIDE; |
| 207 virtual void Unparent() OVERRIDE; |
| 208 virtual RenderWidgetHostView* CreateRenderWidgetHostView( |
| 209 RenderWidgetHost* render_widget_host) OVERRIDE; |
| 210 virtual gfx::NativeWindow GetTopLevelNativeWindow() const OVERRIDE; |
| 211 virtual void SetPageTitle(const std::wstring& title) OVERRIDE; |
| 212 virtual void StartDragging(const WebDropData& drop_data, |
| 213 WebKit::WebDragOperationsMask ops, |
| 214 const SkBitmap& image, |
| 215 const gfx::Point& image_offset) OVERRIDE; |
| 216 virtual void CancelDrag() OVERRIDE; |
| 217 virtual bool IsDoingDrag() const OVERRIDE; |
| 218 virtual void SetDragCursor(WebKit::WebDragOperation operation) OVERRIDE; |
| 219 virtual views::NativeWidget* AsNativeWidget() OVERRIDE; |
| 220 |
| 221 // Overridden from views::WidgetGtk: |
| 222 virtual gboolean OnMotionNotify(GtkWidget* widget, |
| 223 GdkEventMotion* event) OVERRIDE; |
| 224 virtual gboolean OnButtonPress(GtkWidget* widget, |
| 225 GdkEventButton* event) OVERRIDE; |
| 226 virtual void OnSizeAllocate(GtkWidget* widget, |
| 227 GtkAllocation* allocation) OVERRIDE; |
| 228 virtual void OnShow(GtkWidget* widget) OVERRIDE; |
| 229 virtual void OnHide(GtkWidget* widget) OVERRIDE; |
| 230 |
| 231 void PositionConstrainedWindows(const gfx::Size& view_size); |
| 232 |
| 233 internal::NativeTabContentsViewDelegate* delegate_; |
| 234 |
| 235 // Whether to ignore the next CHAR keyboard event. |
| 236 bool ignore_next_char_event_; |
| 237 |
| 238 // Handles drags from this TabContentsView. |
| 239 scoped_ptr<TabContentsDragSource> drag_source_; |
| 240 |
| 241 // The event for the last mouse down we handled. We need this for drags. |
| 242 GdkEventButton last_mouse_down_; |
| 243 |
| 244 // The helper object that handles drag destination related interactions with |
| 245 // GTK. |
| 246 scoped_ptr<WebDragDestGtk> drag_dest_; |
| 247 |
| 248 // Current size. See comment in WidgetGtk as to why this is cached. |
| 249 gfx::Size size_; |
| 250 |
| 251 // Each individual UI for constrained dialogs currently displayed. The |
| 252 // objects in this vector are owned by the TabContents, not the view. |
| 253 std::vector<ConstrainedWindowGtk*> constrained_windows_; |
| 254 |
| 255 DISALLOW_COPY_AND_ASSIGN(NativeTabContentsViewGtk); |
| 256 }; |
| 257 |
| 258 #endif // CHROME_BROWSER_UI_VIEWS_TAB_CONTENTS_NATIVE_TAB_CONTENTS_VIEW_GTK_H_ |
| 259 |
OLD | NEW |