| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/browser/web_contents/web_contents_view_gtk.h" | 5 #include "content/browser/web_contents/web_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 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 // TakeFocus(). | 355 // TakeFocus(). |
| 356 if (gtk_widget_is_focus(widget)) | 356 if (gtk_widget_is_focus(widget)) |
| 357 return FALSE; | 357 return FALSE; |
| 358 | 358 |
| 359 gtk_widget_grab_focus(widget); | 359 gtk_widget_grab_focus(widget); |
| 360 bool reverse = focus == GTK_DIR_TAB_BACKWARD; | 360 bool reverse = focus == GTK_DIR_TAB_BACKWARD; |
| 361 web_contents_->FocusThroughTabTraversal(reverse); | 361 web_contents_->FocusThroughTabTraversal(reverse); |
| 362 return TRUE; | 362 return TRUE; |
| 363 } | 363 } |
| 364 | 364 |
| 365 void WebContentsViewGtk::ShowContextMenu(const ContextMenuParams& params) { | 365 void WebContentsViewGtk::ShowContextMenu(RenderFrameHost* render_frame_host, |
| 366 const ContextMenuParams& params) { |
| 366 if (delegate_) | 367 if (delegate_) |
| 367 delegate_->ShowContextMenu(params); | 368 delegate_->ShowContextMenu(render_frame_host, params); |
| 368 else | 369 else |
| 369 DLOG(ERROR) << "Cannot show context menus without a delegate."; | 370 DLOG(ERROR) << "Cannot show context menus without a delegate."; |
| 370 } | 371 } |
| 371 | 372 |
| 372 void WebContentsViewGtk::ShowPopupMenu(const gfx::Rect& bounds, | 373 void WebContentsViewGtk::ShowPopupMenu(const gfx::Rect& bounds, |
| 373 int item_height, | 374 int item_height, |
| 374 double item_font_size, | 375 double item_font_size, |
| 375 int selected_item, | 376 int selected_item, |
| 376 const std::vector<MenuItem>& items, | 377 const std::vector<MenuItem>& items, |
| 377 bool right_aligned, | 378 bool right_aligned, |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 422 // We manually tell our RWHV to resize the renderer content. This avoids | 423 // We manually tell our RWHV to resize the renderer content. This avoids |
| 423 // spurious resizes from GTK+. | 424 // spurious resizes from GTK+. |
| 424 RenderWidgetHostView* rwhv = web_contents_->GetRenderWidgetHostView(); | 425 RenderWidgetHostView* rwhv = web_contents_->GetRenderWidgetHostView(); |
| 425 if (rwhv) | 426 if (rwhv) |
| 426 rwhv->SetSize(size); | 427 rwhv->SetSize(size); |
| 427 if (web_contents_->GetInterstitialPage()) | 428 if (web_contents_->GetInterstitialPage()) |
| 428 web_contents_->GetInterstitialPage()->SetSize(size); | 429 web_contents_->GetInterstitialPage()->SetSize(size); |
| 429 } | 430 } |
| 430 | 431 |
| 431 } // namespace content | 432 } // namespace content |
| OLD | NEW |