| 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_WEB_CONTENTS_VIEW_GTK_H_ | 5 #ifndef CHROME_BROWSER_TAB_CONTENTS_WEB_CONTENTS_VIEW_GTK_H_ |
| 6 #define CHROME_BROWSER_TAB_CONTENTS_WEB_CONTENTS_VIEW_GTK_H_ | 6 #define CHROME_BROWSER_TAB_CONTENTS_WEB_CONTENTS_VIEW_GTK_H_ |
| 7 | 7 |
| 8 #include "base/scoped_ptr.h" | 8 #include "base/scoped_ptr.h" |
| 9 #include "chrome/browser/tab_contents/web_contents_view.h" | 9 #include "chrome/browser/tab_contents/web_contents_view.h" |
| 10 #include "chrome/common/owned_widget_gtk.h" | 10 #include "chrome/common/owned_widget_gtk.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 virtual void SizeContents(const gfx::Size& size); | 35 virtual void SizeContents(const gfx::Size& size); |
| 36 virtual void FindInPage(const Browser& browser, | 36 virtual void FindInPage(const Browser& browser, |
| 37 bool find_next, bool forward_direction); | 37 bool find_next, bool forward_direction); |
| 38 virtual void HideFindBar(bool end_session); | 38 virtual void HideFindBar(bool end_session); |
| 39 virtual void ReparentFindWindow(Browser* new_browser) const; | 39 virtual void ReparentFindWindow(Browser* new_browser) const; |
| 40 virtual bool GetFindBarWindowInfo(gfx::Point* position, | 40 virtual bool GetFindBarWindowInfo(gfx::Point* position, |
| 41 bool* fully_visible) const; | 41 bool* fully_visible) const; |
| 42 virtual void SetInitialFocus(); | 42 virtual void SetInitialFocus(); |
| 43 virtual void StoreFocus(); | 43 virtual void StoreFocus(); |
| 44 virtual void RestoreFocus(); | 44 virtual void RestoreFocus(); |
| 45 virtual void SetChildSize(RenderWidgetHostView* rwh_view); |
| 45 | 46 |
| 46 // Backend implementation of RenderViewHostDelegate::View. | 47 // Backend implementation of RenderViewHostDelegate::View. |
| 47 virtual void ShowContextMenu(const ContextMenuParams& params); | 48 virtual void ShowContextMenu(const ContextMenuParams& params); |
| 48 virtual void StartDragging(const WebDropData& drop_data); | 49 virtual void StartDragging(const WebDropData& drop_data); |
| 49 virtual void UpdateDragCursor(bool is_drop_target); | 50 virtual void UpdateDragCursor(bool is_drop_target); |
| 50 virtual void TakeFocus(bool reverse); | 51 virtual void TakeFocus(bool reverse); |
| 51 virtual void HandleKeyboardEvent(const NativeWebKeyboardEvent& event); | 52 virtual void HandleKeyboardEvent(const NativeWebKeyboardEvent& event); |
| 52 virtual void OnFindReply(int request_id, | 53 virtual void OnFindReply(int request_id, |
| 53 int number_of_matches, | 54 int number_of_matches, |
| 54 const gfx::Rect& selection_rect, | 55 const gfx::Rect& selection_rect, |
| 55 int active_match_ordinal, | 56 int active_match_ordinal, |
| 56 bool final_update); | 57 bool final_update); |
| 58 |
| 57 private: | 59 private: |
| 58 // We keep track of the timestamp of the latest mousedown event. | 60 // We keep track of the timestamp of the latest mousedown event. |
| 59 static gboolean OnMouseDown(GtkWidget* widget, | 61 static gboolean OnMouseDown(GtkWidget* widget, |
| 60 GdkEventButton* event, WebContentsViewGtk* view); | 62 GdkEventButton* event, WebContentsViewGtk* view); |
| 61 | 63 |
| 62 // The native widget for the tab. | 64 // The native widget for the tab. |
| 63 OwnedWidgetGtk vbox_; | 65 OwnedWidgetGtk vbox_; |
| 64 | 66 |
| 65 // The native widget for the contents of the tab. We do not own this widget. | 67 // The native widget for the contents of the tab. We do not own this widget. |
| 66 GtkWidget* content_view_; | 68 GtkWidget* content_view_; |
| 67 | 69 |
| 68 // The context menu is reset every time we show it, but we keep a pointer to | 70 // The context menu is reset every time we show it, but we keep a pointer to |
| 69 // between uses so that it won't go out of scope before we're done with it. | 71 // between uses so that it won't go out of scope before we're done with it. |
| 70 scoped_ptr<RenderViewContextMenuGtk> context_menu_; | 72 scoped_ptr<RenderViewContextMenuGtk> context_menu_; |
| 71 | 73 |
| 72 // The event time for the last mouse down we handled. We need this to properly | 74 // The event time for the last mouse down we handled. We need this to properly |
| 73 // show context menus. | 75 // show context menus. |
| 74 guint32 last_mouse_down_time_; | 76 guint32 last_mouse_down_time_; |
| 75 | 77 |
| 76 DISALLOW_COPY_AND_ASSIGN(WebContentsViewGtk); | 78 DISALLOW_COPY_AND_ASSIGN(WebContentsViewGtk); |
| 77 }; | 79 }; |
| 78 | 80 |
| 79 #endif // CHROME_BROWSER_TAB_CONTENTS_WEB_CONTENTS_VIEW_GTK_H_ | 81 #endif // CHROME_BROWSER_TAB_CONTENTS_WEB_CONTENTS_VIEW_GTK_H_ |
| OLD | NEW |