| 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 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 last_mouse_down_.time)); | 304 last_mouse_down_.time)); |
| 305 context_menu_->Init(); | 305 context_menu_->Init(); |
| 306 | 306 |
| 307 gfx::Rect bounds; | 307 gfx::Rect bounds; |
| 308 GetContainerBounds(&bounds); | 308 GetContainerBounds(&bounds); |
| 309 gfx::Point point = bounds.origin(); | 309 gfx::Point point = bounds.origin(); |
| 310 point.Offset(params.x, params.y); | 310 point.Offset(params.x, params.y); |
| 311 context_menu_->Popup(point); | 311 context_menu_->Popup(point); |
| 312 } | 312 } |
| 313 | 313 |
| 314 void TabContentsViewGtk::ShowPopupMenu(const gfx::Rect& bounds, |
| 315 int item_height, |
| 316 double item_font_size, |
| 317 int selected_item, |
| 318 const std::vector<WebMenuItem>& items, |
| 319 bool right_aligned) { |
| 320 // We are not using external popup menus on Linux, they are rendered by |
| 321 // WebKit. |
| 322 NOTREACHED(); |
| 323 } |
| 324 |
| 314 // Render view DnD ------------------------------------------------------------- | 325 // Render view DnD ------------------------------------------------------------- |
| 315 | 326 |
| 316 void TabContentsViewGtk::StartDragging(const WebDropData& drop_data, | 327 void TabContentsViewGtk::StartDragging(const WebDropData& drop_data, |
| 317 WebDragOperationsMask ops, | 328 WebDragOperationsMask ops, |
| 318 const SkBitmap& image, | 329 const SkBitmap& image, |
| 319 const gfx::Point& image_offset) { | 330 const gfx::Point& image_offset) { |
| 320 DCHECK(GetContentNativeView()); | 331 DCHECK(GetContentNativeView()); |
| 321 drag_source_->StartDragging(drop_data, ops, &last_mouse_down_, image, | 332 drag_source_->StartDragging(drop_data, ops, &last_mouse_down_, image, |
| 322 image_offset); | 333 image_offset); |
| 323 } | 334 } |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 413 g_value_set_int(&value, child_x); | 424 g_value_set_int(&value, child_x); |
| 414 gtk_container_child_set_property(GTK_CONTAINER(floating_container), | 425 gtk_container_child_set_property(GTK_CONTAINER(floating_container), |
| 415 widget, "x", &value); | 426 widget, "x", &value); |
| 416 | 427 |
| 417 int child_y = std::max((allocation->height - requisition.height) / 2, 0); | 428 int child_y = std::max((allocation->height - requisition.height) / 2, 0); |
| 418 g_value_set_int(&value, child_y); | 429 g_value_set_int(&value, child_y); |
| 419 gtk_container_child_set_property(GTK_CONTAINER(floating_container), | 430 gtk_container_child_set_property(GTK_CONTAINER(floating_container), |
| 420 widget, "y", &value); | 431 widget, "y", &value); |
| 421 g_value_unset(&value); | 432 g_value_unset(&value); |
| 422 } | 433 } |
| OLD | NEW |