| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "content/browser/tab_contents/tab_contents_view_gtk.h" | 5 #include "content/browser/tab_contents/tab_contents_view_gtk.h" |
| 6 | 6 |
| 7 #include <gdk/gdk.h> | 7 #include <gdk/gdk.h> |
| 8 #include <gdk/gdkkeysyms.h> | 8 #include <gdk/gdkkeysyms.h> |
| 9 #include <gtk/gtk.h> | 9 #include <gtk/gtk.h> |
| 10 | 10 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 #include "content/public/browser/web_contents_delegate.h" | 23 #include "content/public/browser/web_contents_delegate.h" |
| 24 #include "content/public/browser/web_contents_view_gtk_delegate.h" | 24 #include "content/public/browser/web_contents_view_gtk_delegate.h" |
| 25 #include "ui/base/gtk/gtk_expanded_container.h" | 25 #include "ui/base/gtk/gtk_expanded_container.h" |
| 26 #include "ui/gfx/point.h" | 26 #include "ui/gfx/point.h" |
| 27 #include "ui/gfx/rect.h" | 27 #include "ui/gfx/rect.h" |
| 28 #include "ui/gfx/size.h" | 28 #include "ui/gfx/size.h" |
| 29 #include "webkit/glue/webdropdata.h" | 29 #include "webkit/glue/webdropdata.h" |
| 30 | 30 |
| 31 using WebKit::WebDragOperation; | 31 using WebKit::WebDragOperation; |
| 32 using WebKit::WebDragOperationsMask; | 32 using WebKit::WebDragOperationsMask; |
| 33 using content::RenderWidgetHost; |
| 33 using content::WebContents; | 34 using content::WebContents; |
| 34 | 35 |
| 35 namespace { | 36 namespace { |
| 36 | 37 |
| 37 // Called when the mouse leaves the widget. We notify our delegate. | 38 // Called when the mouse leaves the widget. We notify our delegate. |
| 38 gboolean OnLeaveNotify(GtkWidget* widget, GdkEventCrossing* event, | 39 gboolean OnLeaveNotify(GtkWidget* widget, GdkEventCrossing* event, |
| 39 TabContents* tab_contents) { | 40 TabContents* tab_contents) { |
| 40 if (tab_contents->GetDelegate()) | 41 if (tab_contents->GetDelegate()) |
| 41 tab_contents->GetDelegate()->ContentsMouseEvent( | 42 tab_contents->GetDelegate()->ContentsMouseEvent( |
| 42 tab_contents, gfx::Point(event->x_root, event->y_root), false); | 43 tab_contents, gfx::Point(event->x_root, event->y_root), false); |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 void TabContentsViewGtk::SizeContents(const gfx::Size& size) { | 197 void TabContentsViewGtk::SizeContents(const gfx::Size& size) { |
| 197 // We don't need to manually set the size of of widgets in GTK+, but we do | 198 // We don't need to manually set the size of of widgets in GTK+, but we do |
| 198 // need to pass the sizing information on to the RWHV which will pass the | 199 // need to pass the sizing information on to the RWHV which will pass the |
| 199 // sizing information on to the renderer. | 200 // sizing information on to the renderer. |
| 200 requested_size_ = size; | 201 requested_size_ = size; |
| 201 RenderWidgetHostView* rwhv = tab_contents_->GetRenderWidgetHostView(); | 202 RenderWidgetHostView* rwhv = tab_contents_->GetRenderWidgetHostView(); |
| 202 if (rwhv) | 203 if (rwhv) |
| 203 rwhv->SetSize(size); | 204 rwhv->SetSize(size); |
| 204 } | 205 } |
| 205 | 206 |
| 206 void TabContentsViewGtk::RenderViewCreated(RenderViewHost* host) { | 207 void TabContentsViewGtk::RenderViewCreated(content::RenderViewHost* host) { |
| 207 } | 208 } |
| 208 | 209 |
| 209 void TabContentsViewGtk::Focus() { | 210 void TabContentsViewGtk::Focus() { |
| 210 if (tab_contents_->ShowingInterstitialPage()) { | 211 if (tab_contents_->ShowingInterstitialPage()) { |
| 211 tab_contents_->GetInterstitialPage()->Focus(); | 212 tab_contents_->GetInterstitialPage()->Focus(); |
| 212 } else if (delegate_.get()) { | 213 } else if (delegate_.get()) { |
| 213 delegate_->Focus(); | 214 delegate_->Focus(); |
| 214 } | 215 } |
| 215 } | 216 } |
| 216 | 217 |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 443 // We manually tell our RWHV to resize the renderer content. This avoids | 444 // We manually tell our RWHV to resize the renderer content. This avoids |
| 444 // spurious resizes from GTK+. | 445 // spurious resizes from GTK+. |
| 445 RenderWidgetHostView* rwhv = tab_contents_->GetRenderWidgetHostView(); | 446 RenderWidgetHostView* rwhv = tab_contents_->GetRenderWidgetHostView(); |
| 446 if (rwhv) | 447 if (rwhv) |
| 447 rwhv->SetSize(size); | 448 rwhv->SetSize(size); |
| 448 if (tab_contents_->GetInterstitialPage()) | 449 if (tab_contents_->GetInterstitialPage()) |
| 449 tab_contents_->GetInterstitialPage()->SetSize(size); | 450 tab_contents_->GetInterstitialPage()->SetSize(size); |
| 450 } | 451 } |
| 451 | 452 |
| 452 } // namespace content | 453 } // namespace content |
| OLD | NEW |