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

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

Issue 9420007: Move RenderWidgetHostView into content namespace. Fix include paths. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix linux_chromeos_gtk build issue not caught by trybots. Created 8 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/tab_contents/render_view_context_menu_gtk.h" 5 #include "chrome/browser/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/string_util.h" 9 #include "base/string_util.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
11 #include "chrome/app/chrome_command_ids.h" 11 #include "chrome/app/chrome_command_ids.h"
12 #include "chrome/browser/ui/gtk/gtk_util.h" 12 #include "chrome/browser/ui/gtk/gtk_util.h"
13 #include "content/browser/renderer_host/render_widget_host_view.h" 13 #include "content/public/browser/render_widget_host_view.h"
14 #include "content/public/browser/web_contents.h" 14 #include "content/public/browser/web_contents.h"
15 #include "content/public/common/context_menu_params.h" 15 #include "content/public/common/context_menu_params.h"
16 #include "grit/generated_resources.h" 16 #include "grit/generated_resources.h"
17 #include "ui/base/l10n/l10n_util.h" 17 #include "ui/base/l10n/l10n_util.h"
18 #include "ui/gfx/gtk_util.h" 18 #include "ui/gfx/gtk_util.h"
19 19
20 using content::WebContents; 20 using content::WebContents;
21 21
22 namespace { 22 namespace {
23 23
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 } 69 }
70 } 70 }
71 return NULL; 71 return NULL;
72 } 72 }
73 73
74 } // namespace 74 } // namespace
75 75
76 RenderViewContextMenuGtk::RenderViewContextMenuGtk( 76 RenderViewContextMenuGtk::RenderViewContextMenuGtk(
77 WebContents* web_contents, 77 WebContents* web_contents,
78 const content::ContextMenuParams& params, 78 const content::ContextMenuParams& params,
79 RenderWidgetHostView* view) 79 content::RenderWidgetHostView* view)
80 : RenderViewContextMenu(web_contents, params) { 80 : RenderViewContextMenu(web_contents, params) {
81 GdkEventButton* event = view->GetLastMouseDown(); 81 GdkEventButton* event = view->GetLastMouseDown();
82 triggering_event_time_ = event ? event->time : GDK_CURRENT_TIME; 82 triggering_event_time_ = event ? event->time : GDK_CURRENT_TIME;
83 } 83 }
84 84
85 RenderViewContextMenuGtk::~RenderViewContextMenuGtk() { 85 RenderViewContextMenuGtk::~RenderViewContextMenuGtk() {
86 } 86 }
87 87
88 void RenderViewContextMenuGtk::PlatformInit() { 88 void RenderViewContextMenuGtk::PlatformInit() {
89 menu_gtk_.reset(new MenuGtk(this, &menu_model_)); 89 menu_gtk_.reset(new MenuGtk(this, &menu_model_));
90 90
91 if (params_.is_editable) { 91 if (params_.is_editable) {
92 RenderWidgetHostView* rwhv = 92 content::RenderWidgetHostView* rwhv =
93 source_web_contents_->GetRenderWidgetHostView(); 93 source_web_contents_->GetRenderWidgetHostView();
94 #if !defined(TOOLKIT_VIEWS) 94 #if !defined(TOOLKIT_VIEWS)
95 if (rwhv) { 95 if (rwhv) {
96 MenuGtk* menu = menu_gtk_.get(); 96 MenuGtk* menu = menu_gtk_.get();
97 gboolean show_input_method_menu = TRUE; 97 gboolean show_input_method_menu = TRUE;
98 98
99 g_object_get( 99 g_object_get(
100 gtk_widget_get_settings(GTK_WIDGET(rwhv->GetNativeView())), 100 gtk_widget_get_settings(GTK_WIDGET(rwhv->GetNativeView())),
101 "gtk-show-input-method-menu", &show_input_method_menu, NULL); 101 "gtk-show-input-method-menu", &show_input_method_menu, NULL);
102 if (!show_input_method_menu) 102 if (!show_input_method_menu)
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 return; 139 return;
140 140
141 // Enable (or disable) the menu item and updates its text. 141 // Enable (or disable) the menu item and updates its text.
142 gtk_widget_set_sensitive(item, enabled); 142 gtk_widget_set_sensitive(item, enabled);
143 if (hidden) 143 if (hidden)
144 gtk_widget_hide(item); 144 gtk_widget_hide(item);
145 else 145 else
146 gtk_widget_show(item); 146 gtk_widget_show(item);
147 gtk_menu_item_set_label(GTK_MENU_ITEM(item), UTF16ToUTF8(title).c_str()); 147 gtk_menu_item_set_label(GTK_MENU_ITEM(item), UTF16ToUTF8(title).c_str());
148 } 148 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698