| 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> |
| 11 | 11 |
| 12 #include "base/scoped_ptr.h" | 12 #include "base/scoped_ptr.h" |
| 13 #include "chrome/browser/gtk/focus_store_gtk.h" | 13 #include "chrome/browser/gtk/focus_store_gtk.h" |
| 14 #include "chrome/browser/tab_contents/tab_contents_view.h" | 14 #include "chrome/browser/tab_contents/tab_contents_view.h" |
| 15 #include "chrome/common/notification_observer.h" | 15 #include "chrome/common/notification_observer.h" |
| 16 #include "chrome/common/notification_registrar.h" | 16 #include "chrome/common/notification_registrar.h" |
| 17 #include "chrome/common/owned_widget_gtk.h" | 17 #include "chrome/common/owned_widget_gtk.h" |
| 18 | 18 |
| 19 class BlockedPopupContainerViewGtk; | 19 class BlockedPopupContainerViewGtk; |
| 20 class ConstrainedWindowGtk; | 20 class ConstrainedWindowGtk; |
| 21 class GtkThemeProperties; |
| 21 class RenderViewContextMenuGtk; | 22 class RenderViewContextMenuGtk; |
| 22 class SadTabGtk; | 23 class SadTabGtk; |
| 23 class WebDragDest; | 24 class WebDragDest; |
| 24 typedef struct _GtkFloatingContainer GtkFloatingContainer; | 25 typedef struct _GtkFloatingContainer GtkFloatingContainer; |
| 25 | 26 |
| 26 class TabContentsViewGtk : public TabContentsView, | 27 class TabContentsViewGtk : public TabContentsView, |
| 27 public NotificationObserver { | 28 public NotificationObserver { |
| 28 public: | 29 public: |
| 29 // The corresponding TabContents is passed in the constructor, and manages our | 30 // The corresponding TabContents is passed in the constructor, and manages our |
| 30 // lifetime. This doesn't need to be the case, but is this way currently | 31 // lifetime. This doesn't need to be the case, but is this way currently |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 private: | 79 private: |
| 79 // Insert the given widget into the content area. Should only be used for | 80 // Insert the given widget into the content area. Should only be used for |
| 80 // web pages and the like (including interstitials and sad tab). Note that | 81 // web pages and the like (including interstitials and sad tab). Note that |
| 81 // 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 |
| 82 // should be taken that the correct one is hidden/shown. | 83 // should be taken that the correct one is hidden/shown. |
| 83 void InsertIntoContentArea(GtkWidget* widget); | 84 void InsertIntoContentArea(GtkWidget* widget); |
| 84 | 85 |
| 85 // Tell webkit the drag is over. | 86 // Tell webkit the drag is over. |
| 86 void DragEnded(); | 87 void DragEnded(); |
| 87 | 88 |
| 89 // Called when the theme is changed. |
| 90 void UserChangedTheme(GtkThemeProperties* properties); |
| 91 |
| 88 // We keep track of the timestamp of the latest mousedown event. | 92 // We keep track of the timestamp of the latest mousedown event. |
| 89 static gboolean OnMouseDown(GtkWidget* widget, | 93 static gboolean OnMouseDown(GtkWidget* widget, |
| 90 GdkEventButton* event, TabContentsViewGtk* view); | 94 GdkEventButton* event, TabContentsViewGtk* view); |
| 91 | 95 |
| 92 // Used to propagate size changes on |fixed_| to its children. | 96 // Used to propagate size changes on |fixed_| to its children. |
| 93 static gboolean OnSizeAllocate(GtkWidget* widget, | 97 static gboolean OnSizeAllocate(GtkWidget* widget, |
| 94 GtkAllocation* config, | 98 GtkAllocation* config, |
| 95 TabContentsViewGtk* view); | 99 TabContentsViewGtk* view); |
| 96 | 100 |
| 97 static void OnSetFloatingPosition( | 101 static void OnSetFloatingPosition( |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 // The mime type for the file contents of the current drag (if any). | 146 // The mime type for the file contents of the current drag (if any). |
| 143 GdkAtom drag_file_mime_type_; | 147 GdkAtom drag_file_mime_type_; |
| 144 // The helper object that handles drag destination related interactions with | 148 // The helper object that handles drag destination related interactions with |
| 145 // GTK. | 149 // GTK. |
| 146 scoped_ptr<WebDragDest> drag_dest_; | 150 scoped_ptr<WebDragDest> drag_dest_; |
| 147 | 151 |
| 148 DISALLOW_COPY_AND_ASSIGN(TabContentsViewGtk); | 152 DISALLOW_COPY_AND_ASSIGN(TabContentsViewGtk); |
| 149 }; | 153 }; |
| 150 | 154 |
| 151 #endif // CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_VIEW_GTK_H_ | 155 #endif // CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_VIEW_GTK_H_ |
| OLD | NEW |