#include "content/shell/browser/shell_web_contents_view_delegate.h"
#include "base/command_line.h"
+#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_process_host.h"
#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"
#include "content/shell/common/shell_switches.h"
#include "third_party/WebKit/public/web/WebContextMenuData.h"
-using WebKit::WebContextMenuData;
+using blink::WebContextMenuData;
namespace {
void MakeContextMenuItem(HMENU menu,
int menu_index,
- LPTSTR text,
+ LPCTSTR text,
UINT id,
bool enabled) {
MENUITEMINFO mii = {0};
mii.fState = enabled ? MFS_ENABLED : (MF_DISABLED | MFS_GRAYED);
mii.fType = MFT_STRING;
mii.wID = id;
- mii.dwTypeData = text;
+ mii.dwTypeData = const_cast<LPTSTR>(text);
InsertMenuItem(menu, menu_index, TRUE, &mii);
}
}
void ShellWebContentsViewDelegate::ShowContextMenu(
+ RenderFrameHost* render_frame_host,
const ContextMenuParams& params) {
if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree))
return;
#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);
void ShellWebContentsViewDelegate::MenuItemSelected(int selection) {
switch (selection) {
case ShellContextMenuItemCutId:
- web_contents_->GetRenderViewHost()->Cut();
+ web_contents_->Cut();
break;
case ShellContextMenuItemCopyId:
- web_contents_->GetRenderViewHost()->Copy();
+ web_contents_->Copy();
break;
case ShellContextMenuItemPasteId:
- web_contents_->GetRenderViewHost()->Paste();
+ web_contents_->Paste();
break;
case ShellContextMenuItemDeleteId:
- web_contents_->GetRenderViewHost()->Delete();
+ web_contents_->Delete();
break;
case ShellContextMenuItemOpenLinkId: {
ShellBrowserContext* browser_context =
}
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_);
}
}
-WebDragDestDelegate* ShellWebContentsViewDelegate::GetDragDestDelegate() {
- return NULL;
+#if defined(TOOLKIT_VIEWS)
+void ShellWebContentsViewDelegate::ShowDisambiguationPopup(
+ const gfx::Rect& target_rect,
+ const SkBitmap& zoomed_bitmap,
+ const gfx::NativeView content,
+ const base::Callback<void(ui::GestureEvent*)>& gesture_cb,
+ const base::Callback<void(ui::MouseEvent*)>& mouse_cb) {
}
-void ShellWebContentsViewDelegate::StoreFocus() {
-}
-
-void ShellWebContentsViewDelegate::RestoreFocus() {
-}
-
-bool ShellWebContentsViewDelegate::Focus() {
- return false;
-}
-
-void ShellWebContentsViewDelegate::TakeFocus(bool reverse) {
-}
-
-void ShellWebContentsViewDelegate::SizeChanged(const gfx::Size& size) {
+void ShellWebContentsViewDelegate::HideDisambiguationPopup() {
}
+#endif
} // namespace content