Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / content / shell / browser / shell_web_contents_view_delegate_mac.mm
index 7dd810c..375112f 100644 (file)
@@ -12,7 +12,6 @@
 #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"
@@ -202,7 +201,7 @@ void ShellWebContentsViewDelegate::ShowContextMenu(
                       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];
@@ -223,23 +222,18 @@ void ShellWebContentsViewDelegate::ShowContextMenu(
 }
 
 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 =
@@ -253,15 +247,15 @@ void ShellWebContentsViewDelegate::ActionPerformed(int tag) {
     }
     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: {