Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / content / shell / browser / shell_web_contents_view_delegate_win.cc
index ce86db2..9eb834d 100644 (file)
@@ -10,7 +10,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"
@@ -175,14 +174,14 @@ void ShellWebContentsViewDelegate::ShowContextMenu(
 #else
   gfx::Point screen_point(params.x, params.y);
   POINT point = screen_point.ToPOINT();
-  ClientToScreen(web_contents_->GetView()->GetNativeView(), &point);
+  ClientToScreen(web_contents_->GetNativeView(), &point);
 
   int selection =
       TrackPopupMenu(sub_menu,
                      TPM_LEFTALIGN | TPM_RIGHTBUTTON | TPM_RETURNCMD,
                      point.x, point.y,
                      0,
-                     web_contents_->GetView()->GetContentNativeView(),
+                     web_contents_->GetContentNativeView(),
                      NULL);
 
   MenuItemSelected(selection);
@@ -191,23 +190,18 @@ void ShellWebContentsViewDelegate::ShowContextMenu(
 }
 
 void ShellWebContentsViewDelegate::MenuItemSelected(int selection) {
-  RenderFrameHost* frame = web_contents_->GetFocusedFrame();
   switch (selection) {
     case ShellContextMenuItemCutId:
-       if (frame)
-         frame->Cut();
+      web_contents_->Cut();
       break;
     case ShellContextMenuItemCopyId:
-      if (frame)
-        frame->Copy();
+      web_contents_->Copy();
       break;
     case ShellContextMenuItemPasteId:
-      if (frame)
-        frame->Paste();
+      web_contents_->Paste();
       break;
     case ShellContextMenuItemDeleteId:
-      if (frame)
-        frame->Delete();
+      web_contents_->Delete();
       break;
     case ShellContextMenuItemOpenLinkId: {
       ShellBrowserContext* browser_context =
@@ -221,15 +215,15 @@ void ShellWebContentsViewDelegate::MenuItemSelected(int selection) {
     }
     case ShellContextMenuItemBackId:
       web_contents_->GetController().GoToOffset(-1);
-      web_contents_->GetView()->Focus();
+      web_contents_->Focus();
       break;
     case ShellContextMenuItemForwardId:
       web_contents_->GetController().GoToOffset(1);
-      web_contents_->GetView()->Focus();
+      web_contents_->Focus();
       break;
     case ShellContextMenuItemReloadId:
       web_contents_->GetController().Reload(false);
-      web_contents_->GetView()->Focus();
+      web_contents_->Focus();
       break;
     case ShellContextMenuItemInspectId: {
       ShellDevToolsFrontend::Show(web_contents_);