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 3 // found in the LICENSE file. 4 5 #ifndef CONTENT_SHELL_BROWSER_SHELL_WEB_CONTENTS_VIEW_DELEGATE_H_ 6 #define CONTENT_SHELL_BROWSER_SHELL_WEB_CONTENTS_VIEW_DELEGATE_H_ 7 8 #include "content/public/browser/web_contents.h" 9 #include "content/public/browser/web_contents_view_delegate.h" 10 #include "content/public/common/context_menu_params.h" 11 12 namespace content { 13 14 class ShellWebContentsViewDelegate : public WebContentsViewDelegate { 15 public: 16 explicit ShellWebContentsViewDelegate(WebContents* web_contents); 17 virtual ~ShellWebContentsViewDelegate(); 18 19 // Overridden from WebContentsViewDelegate: 20 virtual void ShowContextMenu(RenderFrameHost* render_frame_host, 21 const ContextMenuParams& params) OVERRIDE; 22 23 #if defined(OS_MACOSX) 24 void ActionPerformed(int id); 25 #elif defined(OS_WIN) 26 void MenuItemSelected(int selection); 27 #endif 28 29 #if defined(TOOLKIT_VIEWS) 30 virtual void ShowDisambiguationPopup( 31 const gfx::Rect& target_rect, 32 const SkBitmap& zoomed_bitmap, 33 const gfx::NativeView content, 34 const base::Callback<void(ui::GestureEvent*)>& gesture_cb, 35 const base::Callback<void(ui::MouseEvent*)>& mouse_cb) OVERRIDE; 36 37 virtual void HideDisambiguationPopup() OVERRIDE; 38 #endif 39 40 private: 41 WebContents* web_contents_; 42 ContextMenuParams params_; 43 44 DISALLOW_COPY_AND_ASSIGN(ShellWebContentsViewDelegate); 45 }; 46 47 } // namespace content 48 49 #endif // CONTENT_SHELL_BROWSER_SHELL_WEB_CONTENTS_VIEW_DELEGATE_H_ 50