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

Side by Side Diff: content/shell/browser/shell_web_contents_view_delegate_win.cc

Issue 183923030: Almost finish moving context_menu_node_ from RenderViewImpl to RenderFrameImpl. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: sync to get android fix Created 6 years, 9 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
« no previous file with comments | « content/shell/browser/shell_web_contents_view_delegate_mac.mm ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/shell/browser/shell_web_contents_view_delegate.h" 5 #include "content/shell/browser/shell_web_contents_view_delegate.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "content/public/browser/render_frame_host.h"
8 #include "content/public/browser/render_process_host.h" 9 #include "content/public/browser/render_process_host.h"
9 #include "content/public/browser/render_view_host.h" 10 #include "content/public/browser/render_view_host.h"
10 #include "content/public/browser/render_widget_host_view.h" 11 #include "content/public/browser/render_widget_host_view.h"
11 #include "content/public/browser/web_contents.h" 12 #include "content/public/browser/web_contents.h"
12 #include "content/public/browser/web_contents_view.h" 13 #include "content/public/browser/web_contents_view.h"
13 #include "content/public/common/context_menu_params.h" 14 #include "content/public/common/context_menu_params.h"
14 #include "content/shell/browser/shell.h" 15 #include "content/shell/browser/shell.h"
15 #include "content/shell/browser/shell_browser_context.h" 16 #include "content/shell/browser/shell_browser_context.h"
16 #include "content/shell/browser/shell_browser_main_parts.h" 17 #include "content/shell/browser/shell_browser_main_parts.h"
17 #include "content/shell/browser/shell_content_browser_client.h" 18 #include "content/shell/browser/shell_content_browser_client.h"
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 0, 184 0,
184 web_contents_->GetView()->GetContentNativeView(), 185 web_contents_->GetView()->GetContentNativeView(),
185 NULL); 186 NULL);
186 187
187 MenuItemSelected(selection); 188 MenuItemSelected(selection);
188 #endif 189 #endif
189 DestroyMenu(menu); 190 DestroyMenu(menu);
190 } 191 }
191 192
192 void ShellWebContentsViewDelegate::MenuItemSelected(int selection) { 193 void ShellWebContentsViewDelegate::MenuItemSelected(int selection) {
194 RenderFrameHost* frame = web_contents_->GetFocusedFrame();
193 switch (selection) { 195 switch (selection) {
194 case ShellContextMenuItemCutId: 196 case ShellContextMenuItemCutId:
195 web_contents_->GetRenderViewHost()->Cut(); 197 if (frame)
198 frame->Cut();
196 break; 199 break;
197 case ShellContextMenuItemCopyId: 200 case ShellContextMenuItemCopyId:
198 web_contents_->GetRenderViewHost()->Copy(); 201 if (frame)
202 frame->Copy();
199 break; 203 break;
200 case ShellContextMenuItemPasteId: 204 case ShellContextMenuItemPasteId:
201 web_contents_->GetRenderViewHost()->Paste(); 205 if (frame)
206 frame->Paste();
202 break; 207 break;
203 case ShellContextMenuItemDeleteId: 208 case ShellContextMenuItemDeleteId:
204 web_contents_->GetRenderViewHost()->Delete(); 209 web_contents_->GetRenderViewHost()->Delete();
205 break; 210 break;
206 case ShellContextMenuItemOpenLinkId: { 211 case ShellContextMenuItemOpenLinkId: {
207 ShellBrowserContext* browser_context = 212 ShellBrowserContext* browser_context =
208 ShellContentBrowserClient::Get()->browser_context(); 213 ShellContentBrowserClient::Get()->browser_context();
209 Shell::CreateNewWindow(browser_context, 214 Shell::CreateNewWindow(browser_context,
210 params_.link_url, 215 params_.link_url,
211 NULL, 216 NULL,
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 return false; 251 return false;
247 } 252 }
248 253
249 void ShellWebContentsViewDelegate::TakeFocus(bool reverse) { 254 void ShellWebContentsViewDelegate::TakeFocus(bool reverse) {
250 } 255 }
251 256
252 void ShellWebContentsViewDelegate::SizeChanged(const gfx::Size& size) { 257 void ShellWebContentsViewDelegate::SizeChanged(const gfx::Size& size) {
253 } 258 }
254 259
255 } // namespace content 260 } // namespace content
OLDNEW
« no previous file with comments | « content/shell/browser/shell_web_contents_view_delegate_mac.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698