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/tab_contents/tab_contents_view_gtk.h" | 5 #include "chrome/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 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 gfx::Rect bounds; | 316 gfx::Rect bounds; |
317 GetContainerBounds(&bounds); | 317 GetContainerBounds(&bounds); |
318 gfx::Point point = bounds.origin(); | 318 gfx::Point point = bounds.origin(); |
319 point.Offset(params.x, params.y); | 319 point.Offset(params.x, params.y); |
320 context_menu_->Popup(point); | 320 context_menu_->Popup(point); |
321 } | 321 } |
322 | 322 |
323 // Render view DnD ------------------------------------------------------------- | 323 // Render view DnD ------------------------------------------------------------- |
324 | 324 |
325 void TabContentsViewGtk::StartDragging(const WebDropData& drop_data, | 325 void TabContentsViewGtk::StartDragging(const WebDropData& drop_data, |
326 WebDragOperationsMask ops) { | 326 WebDragOperationsMask ops, |
| 327 const SkBitmap& image, |
| 328 const gfx::Point& image_offset) { |
327 DCHECK(GetContentNativeView()); | 329 DCHECK(GetContentNativeView()); |
328 | 330 |
329 drag_source_->StartDragging(drop_data, &last_mouse_down_); | 331 drag_source_->StartDragging(drop_data, &last_mouse_down_, image, |
| 332 image_offset); |
330 // TODO(snej): Make use of the WebDragOperationsMask somehow | 333 // TODO(snej): Make use of the WebDragOperationsMask somehow |
331 } | 334 } |
332 | 335 |
333 // ----------------------------------------------------------------------------- | 336 // ----------------------------------------------------------------------------- |
334 | 337 |
335 void TabContentsViewGtk::InsertIntoContentArea(GtkWidget* widget) { | 338 void TabContentsViewGtk::InsertIntoContentArea(GtkWidget* widget) { |
336 gtk_container_add(GTK_CONTAINER(expanded_), widget); | 339 gtk_container_add(GTK_CONTAINER(expanded_), widget); |
337 } | 340 } |
338 | 341 |
339 gboolean TabContentsViewGtk::OnMouseDown(GtkWidget* widget, | 342 gboolean TabContentsViewGtk::OnMouseDown(GtkWidget* widget, |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
394 gtk_container_child_set_property(GTK_CONTAINER(floating_container), | 397 gtk_container_child_set_property(GTK_CONTAINER(floating_container), |
395 widget, "x", &value); | 398 widget, "x", &value); |
396 | 399 |
397 int child_y = std::max(half_view_height - (requisition.height / 2), 0); | 400 int child_y = std::max(half_view_height - (requisition.height / 2), 0); |
398 g_value_set_int(&value, child_y); | 401 g_value_set_int(&value, child_y); |
399 gtk_container_child_set_property(GTK_CONTAINER(floating_container), | 402 gtk_container_child_set_property(GTK_CONTAINER(floating_container), |
400 widget, "y", &value); | 403 widget, "y", &value); |
401 g_value_unset(&value); | 404 g_value_unset(&value); |
402 } | 405 } |
403 } | 406 } |
OLD | NEW |