#include "content/public/browser/render_view_host.h"
#include "content/public/browser/render_widget_host_view.h"
#include "content/public/browser/web_contents.h"
-#include "content/public/browser/web_contents_view.h"
#include "content/public/common/context_menu_params.h"
#include "content/shell/browser/shell.h"
#include "content/shell/browser/shell_browser_context.h"
YES,
delegate);
- NSView* parent_view = web_contents_->GetView()->GetContentNativeView();
+ NSView* parent_view = web_contents_->GetContentNativeView();
NSEvent* currentEvent = [NSApp currentEvent];
NSWindow* window = [parent_view window];
NSPoint position = [window mouseLocationOutsideOfEventStream];
}
void ShellWebContentsViewDelegate::ActionPerformed(int tag) {
- RenderFrameHost* frame = web_contents_->GetFocusedFrame();
switch (tag) {
case ShellContextMenuItemCutTag:
- if (frame)
- frame->Cut();
+ web_contents_->Cut();
break;
case ShellContextMenuItemCopyTag:
- if (frame)
- frame->Copy();
+ web_contents_->Copy();
break;
case ShellContextMenuItemPasteTag:
- if (frame)
- frame->Paste();
+ web_contents_->Paste();
break;
case ShellContextMenuItemDeleteTag:
- if (frame)
- frame->Delete();
+ web_contents_->Delete();
break;
case ShellContextMenuItemOpenLinkTag: {
ShellBrowserContext* browser_context =
}
case ShellContextMenuItemBackTag:
web_contents_->GetController().GoToOffset(-1);
- web_contents_->GetView()->Focus();
+ web_contents_->Focus();
break;
case ShellContextMenuItemForwardTag:
web_contents_->GetController().GoToOffset(1);
- web_contents_->GetView()->Focus();
+ web_contents_->Focus();
break;
case ShellContextMenuItemReloadTag: {
web_contents_->GetController().Reload(false);
- web_contents_->GetView()->Focus();
+ web_contents_->Focus();
break;
}
case ShellContextMenuItemInspectTag: {