Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(437)

Side by Side Diff: chrome/browser/ui/gtk/tab_contents/render_view_context_menu_gtk.cc

Issue 130773004: Start moving context menu code to RenderFrame. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "chrome/browser/ui/gtk/tab_contents/render_view_context_menu_gtk.h" 5 #include "chrome/browser/ui/gtk/tab_contents/render_view_context_menu_gtk.h"
6 6
7 #include <gtk/gtk.h> 7 #include <gtk/gtk.h>
8 8
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 if (subitem) 68 if (subitem)
69 return subitem; 69 return subitem;
70 } 70 }
71 } 71 }
72 return NULL; 72 return NULL;
73 } 73 }
74 74
75 } // namespace 75 } // namespace
76 76
77 RenderViewContextMenuGtk::RenderViewContextMenuGtk( 77 RenderViewContextMenuGtk::RenderViewContextMenuGtk(
78 WebContents* web_contents, 78 content::RenderFrameHost* render_frame_host,
79 const content::ContextMenuParams& params, 79 const content::ContextMenuParams& params,
80 content::RenderWidgetHostView* view) 80 content::RenderWidgetHostView* view)
81 : RenderViewContextMenu(web_contents, params), 81 : RenderViewContextMenu(render_frame_host, params),
82 bidi_submenu_model_(this) { 82 bidi_submenu_model_(this) {
83 GdkEventButton* event = view->GetLastMouseDown(); 83 GdkEventButton* event = view->GetLastMouseDown();
84 triggering_event_time_ = event ? event->time : GDK_CURRENT_TIME; 84 triggering_event_time_ = event ? event->time : GDK_CURRENT_TIME;
85 } 85 }
86 86
87 RenderViewContextMenuGtk::~RenderViewContextMenuGtk() { 87 RenderViewContextMenuGtk::~RenderViewContextMenuGtk() {
88 } 88 }
89 89
90 void RenderViewContextMenuGtk::PlatformInit() { 90 void RenderViewContextMenuGtk::PlatformInit() {
91 menu_gtk_.reset(new MenuGtk(this, &menu_model_)); 91 menu_gtk_.reset(new MenuGtk(this, &menu_model_));
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 233
234 // Enable (or disable) the menu item and updates its text. 234 // Enable (or disable) the menu item and updates its text.
235 gtk_widget_set_sensitive(item, enabled); 235 gtk_widget_set_sensitive(item, enabled);
236 if (hidden) 236 if (hidden)
237 gtk_widget_hide(item); 237 gtk_widget_hide(item);
238 else 238 else
239 gtk_widget_show(item); 239 gtk_widget_show(item);
240 gtk_menu_item_set_label(GTK_MENU_ITEM(item), 240 gtk_menu_item_set_label(GTK_MENU_ITEM(item),
241 base::UTF16ToUTF8(title).c_str()); 241 base::UTF16ToUTF8(title).c_str());
242 } 242 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698