| 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 "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 386 views::View::ConvertPointToScreen(GetRootView(), &screen_point); | 386 views::View::ConvertPointToScreen(GetRootView(), &screen_point); |
| 387 | 387 |
| 388 // Enable recursive tasks on the message loop so we can get updates while | 388 // Enable recursive tasks on the message loop so we can get updates while |
| 389 // the context menu is being displayed. | 389 // the context menu is being displayed. |
| 390 bool old_state = MessageLoop::current()->NestableTasksAllowed(); | 390 bool old_state = MessageLoop::current()->NestableTasksAllowed(); |
| 391 MessageLoop::current()->SetNestableTasksAllowed(true); | 391 MessageLoop::current()->SetNestableTasksAllowed(true); |
| 392 context_menu_->RunMenuAt(screen_point.x(), screen_point.y()); | 392 context_menu_->RunMenuAt(screen_point.x(), screen_point.y()); |
| 393 MessageLoop::current()->SetNestableTasksAllowed(old_state); | 393 MessageLoop::current()->SetNestableTasksAllowed(old_state); |
| 394 } | 394 } |
| 395 | 395 |
| 396 void TabContentsViewGtk::ShowPopupMenu(const gfx::Rect& bounds, |
| 397 int item_height, |
| 398 double item_font_size, |
| 399 int selected_item, |
| 400 const std::vector<WebMenuItem>& items, |
| 401 bool right_aligned) { |
| 402 // External popup menus are only used on Mac. |
| 403 NOTREACHED(); |
| 404 } |
| 405 |
| 396 gboolean TabContentsViewGtk::OnButtonPress(GtkWidget* widget, | 406 gboolean TabContentsViewGtk::OnButtonPress(GtkWidget* widget, |
| 397 GdkEventButton* event) { | 407 GdkEventButton* event) { |
| 398 last_mouse_down_ = *event; | 408 last_mouse_down_ = *event; |
| 399 return views::WidgetGtk::OnButtonPress(widget, event); | 409 return views::WidgetGtk::OnButtonPress(widget, event); |
| 400 } | 410 } |
| 401 | 411 |
| 402 void TabContentsViewGtk::OnSizeAllocate(GtkWidget* widget, | 412 void TabContentsViewGtk::OnSizeAllocate(GtkWidget* widget, |
| 403 GtkAllocation* allocation) { | 413 GtkAllocation* allocation) { |
| 404 gfx::Size new_size(allocation->width, allocation->height); | 414 gfx::Size new_size(allocation->width, allocation->height); |
| 405 | 415 |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 493 // not NULL, else our delegate. | 503 // not NULL, else our delegate. |
| 494 gboolean TabContentsViewGtk::OnMouseMove(GtkWidget* widget, | 504 gboolean TabContentsViewGtk::OnMouseMove(GtkWidget* widget, |
| 495 GdkEventMotion* event) { | 505 GdkEventMotion* event) { |
| 496 if (sad_tab_ != NULL) | 506 if (sad_tab_ != NULL) |
| 497 WidgetGtk::OnMotionNotify(widget, event); | 507 WidgetGtk::OnMotionNotify(widget, event); |
| 498 else if (tab_contents()->delegate()) | 508 else if (tab_contents()->delegate()) |
| 499 tab_contents()->delegate()->ContentsMouseEvent( | 509 tab_contents()->delegate()->ContentsMouseEvent( |
| 500 tab_contents(), views::Screen::GetCursorScreenPoint(), true); | 510 tab_contents(), views::Screen::GetCursorScreenPoint(), true); |
| 501 return FALSE; | 511 return FALSE; |
| 502 } | 512 } |
| OLD | NEW |