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 "chrome/browser/tab_contents/chrome_web_contents_view_gtk_delegate.h" | 5 #include "chrome/browser/tab_contents/chrome_web_contents_view_gtk_delegate.h" |
6 | 6 |
7 #include "chrome/browser/browser_shutdown.h" | 7 #include "chrome/browser/browser_shutdown.h" |
8 #include "chrome/browser/tab_contents/render_view_context_menu_gtk.h" | 8 #include "chrome/browser/tab_contents/render_view_context_menu_gtk.h" |
9 #include "chrome/browser/tab_contents/web_drag_bookmark_handler_gtk.h" | 9 #include "chrome/browser/tab_contents/web_drag_bookmark_handler_gtk.h" |
10 #include "chrome/browser/ui/gtk/constrained_window_gtk.h" | 10 #include "chrome/browser/ui/gtk/constrained_window_gtk.h" |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 content::RenderWidgetHostView* view = NULL; | 105 content::RenderWidgetHostView* view = NULL; |
106 if (params.custom_context.render_widget_id != | 106 if (params.custom_context.render_widget_id != |
107 content::CustomContextMenuContext::kCurrentRenderWidget) { | 107 content::CustomContextMenuContext::kCurrentRenderWidget) { |
108 IPC::Channel::Listener* listener = | 108 IPC::Channel::Listener* listener = |
109 view_->web_contents()->GetRenderProcessHost()->GetListenerByID( | 109 view_->web_contents()->GetRenderProcessHost()->GetListenerByID( |
110 params.custom_context.render_widget_id); | 110 params.custom_context.render_widget_id); |
111 if (!listener) { | 111 if (!listener) { |
112 NOTREACHED(); | 112 NOTREACHED(); |
113 return; | 113 return; |
114 } | 114 } |
115 view = RenderWidgetHost::FromIPCChannelListener(listener)->view(); | 115 view = RenderWidgetHost::FromIPCChannelListener(listener)->GetView(); |
116 } else { | 116 } else { |
117 view = view_->web_contents()->GetRenderWidgetHostView(); | 117 view = view_->web_contents()->GetRenderWidgetHostView(); |
118 } | 118 } |
119 | 119 |
120 context_menu_.reset( | 120 context_menu_.reset( |
121 new RenderViewContextMenuGtk(view_->web_contents(), params, view)); | 121 new RenderViewContextMenuGtk(view_->web_contents(), params, view)); |
122 context_menu_->Init(); | 122 context_menu_->Init(); |
123 | 123 |
124 gfx::Rect bounds; | 124 gfx::Rect bounds; |
125 view_->GetContainerBounds(&bounds); | 125 view_->GetContainerBounds(&bounds); |
(...skipping 21 matching lines...) Expand all Loading... |
147 g_value_set_int(&value, child_x); | 147 g_value_set_int(&value, child_x); |
148 gtk_container_child_set_property(GTK_CONTAINER(floating_container), | 148 gtk_container_child_set_property(GTK_CONTAINER(floating_container), |
149 widget, "x", &value); | 149 widget, "x", &value); |
150 | 150 |
151 int child_y = std::max((allocation->height - requisition.height) / 2, 0); | 151 int child_y = std::max((allocation->height - requisition.height) / 2, 0); |
152 g_value_set_int(&value, child_y); | 152 g_value_set_int(&value, child_y); |
153 gtk_container_child_set_property(GTK_CONTAINER(floating_container), | 153 gtk_container_child_set_property(GTK_CONTAINER(floating_container), |
154 widget, "y", &value); | 154 widget, "y", &value); |
155 g_value_unset(&value); | 155 g_value_unset(&value); |
156 } | 156 } |
OLD | NEW |