| 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 #include "chrome/browser/views/tab_contents/tab_contents_view_gtk.h" | 5 #include "chrome/browser/views/tab_contents/tab_contents_view_gtk.h" |
| 6 | 6 |
| 7 #include <gdk/gdk.h> | 7 #include <gdk/gdk.h> |
| 8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
| 9 | 9 |
| 10 #include "app/gfx/canvas_paint.h" | 10 #include "app/gfx/canvas_paint.h" |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 void TabContentsViewGtk::GetContainerBounds(gfx::Rect* out) const { | 212 void TabContentsViewGtk::GetContainerBounds(gfx::Rect* out) const { |
| 213 GetBounds(out, false); | 213 GetBounds(out, false); |
| 214 | 214 |
| 215 // Callers expect the requested bounds not the actual bounds. For example, | 215 // Callers expect the requested bounds not the actual bounds. For example, |
| 216 // during init callers expect 0x0, but Gtk layout enforces a min size of 1x1. | 216 // during init callers expect 0x0, but Gtk layout enforces a min size of 1x1. |
| 217 out->set_width(GetNativeView()->requisition.width); | 217 out->set_width(GetNativeView()->requisition.width); |
| 218 out->set_height(GetNativeView()->requisition.height); | 218 out->set_height(GetNativeView()->requisition.height); |
| 219 } | 219 } |
| 220 | 220 |
| 221 void TabContentsViewGtk::StartDragging(const WebDropData& drop_data, | 221 void TabContentsViewGtk::StartDragging(const WebDropData& drop_data, |
| 222 WebDragOperationsMask ops) { | 222 WebDragOperationsMask ops, |
| 223 drag_source_->StartDragging(drop_data, &last_mouse_down_); | 223 const SkBitmap& image, |
| 224 const gfx::Point& image_offset) { |
| 225 drag_source_->StartDragging(drop_data, &last_mouse_down_, |
| 226 image, image_offset); |
| 224 // TODO(snej): Make use of WebDragOperationsMask | 227 // TODO(snej): Make use of WebDragOperationsMask |
| 225 } | 228 } |
| 226 | 229 |
| 227 void TabContentsViewGtk::SetPageTitle(const std::wstring& title) { | 230 void TabContentsViewGtk::SetPageTitle(const std::wstring& title) { |
| 228 // Set the window name to include the page title so it's easier to spot | 231 // Set the window name to include the page title so it's easier to spot |
| 229 // when debugging (e.g. via xwininfo -tree). | 232 // when debugging (e.g. via xwininfo -tree). |
| 230 gfx::NativeView content_view = GetContentNativeView(); | 233 gfx::NativeView content_view = GetContentNativeView(); |
| 231 if (content_view && content_view->window) | 234 if (content_view && content_view->window) |
| 232 gdk_window_set_title(content_view->window, WideToUTF8(title).c_str()); | 235 gdk_window_set_title(content_view->window, WideToUTF8(title).c_str()); |
| 233 } | 236 } |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 429 // not NULL, else our delegate. | 432 // not NULL, else our delegate. |
| 430 gboolean TabContentsViewGtk::OnMouseMove(GtkWidget* widget, | 433 gboolean TabContentsViewGtk::OnMouseMove(GtkWidget* widget, |
| 431 GdkEventMotion* event) { | 434 GdkEventMotion* event) { |
| 432 if (sad_tab_ != NULL) | 435 if (sad_tab_ != NULL) |
| 433 WidgetGtk::OnMotionNotify(widget, event); | 436 WidgetGtk::OnMotionNotify(widget, event); |
| 434 else if (tab_contents()->delegate()) | 437 else if (tab_contents()->delegate()) |
| 435 tab_contents()->delegate()->ContentsMouseEvent( | 438 tab_contents()->delegate()->ContentsMouseEvent( |
| 436 tab_contents(), views::Screen::GetCursorScreenPoint(), true); | 439 tab_contents(), views::Screen::GetCursorScreenPoint(), true); |
| 437 return FALSE; | 440 return FALSE; |
| 438 } | 441 } |
| OLD | NEW |