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 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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, | 327 const SkBitmap& image, |
328 const gfx::Point& image_offset) { | 328 const gfx::Point& image_offset) { |
329 DCHECK(GetContentNativeView()); | 329 DCHECK(GetContentNativeView()); |
330 | 330 drag_source_->StartDragging(drop_data, ops, &last_mouse_down_, image, |
331 drag_source_->StartDragging(drop_data, &last_mouse_down_, image, | |
332 image_offset); | 331 image_offset); |
333 // TODO(snej): Make use of the WebDragOperationsMask somehow | |
334 } | 332 } |
335 | 333 |
336 // ----------------------------------------------------------------------------- | 334 // ----------------------------------------------------------------------------- |
337 | 335 |
338 void TabContentsViewGtk::InsertIntoContentArea(GtkWidget* widget) { | 336 void TabContentsViewGtk::InsertIntoContentArea(GtkWidget* widget) { |
339 gtk_container_add(GTK_CONTAINER(expanded_), widget); | 337 gtk_container_add(GTK_CONTAINER(expanded_), widget); |
340 } | 338 } |
341 | 339 |
342 gboolean TabContentsViewGtk::OnMouseDown(GtkWidget* widget, | 340 gboolean TabContentsViewGtk::OnMouseDown(GtkWidget* widget, |
343 GdkEventButton* event) { | 341 GdkEventButton* event) { |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
393 gtk_container_child_set_property(GTK_CONTAINER(floating_container), | 391 gtk_container_child_set_property(GTK_CONTAINER(floating_container), |
394 widget, "x", &value); | 392 widget, "x", &value); |
395 | 393 |
396 int child_y = std::max(half_view_height - (requisition.height / 2), 0); | 394 int child_y = std::max(half_view_height - (requisition.height / 2), 0); |
397 g_value_set_int(&value, child_y); | 395 g_value_set_int(&value, child_y); |
398 gtk_container_child_set_property(GTK_CONTAINER(floating_container), | 396 gtk_container_child_set_property(GTK_CONTAINER(floating_container), |
399 widget, "y", &value); | 397 widget, "y", &value); |
400 g_value_unset(&value); | 398 g_value_unset(&value); |
401 } | 399 } |
402 } | 400 } |
OLD | NEW |