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 virtual WebDragDestDelegate* GetDragDestDelegate() OVERRIDE; 23 24 #if defined(OS_MACOSX) 25 virtual NSObject<RenderWidgetHostViewMacDelegate>* 26 CreateRenderWidgetHostViewDelegate( 27 RenderWidgetHost* render_widget_host) OVERRIDE; 28 void ActionPerformed(int id); 29 #elif defined(OS_WIN) 30 virtual void StoreFocus() OVERRIDE; 31 virtual void RestoreFocus() OVERRIDE; 32 virtual bool Focus() OVERRIDE; 33 virtual void TakeFocus(bool reverse) OVERRIDE; 34 virtual void SizeChanged(const gfx::Size& size) OVERRIDE; 35 void MenuItemSelected(int selection); 36 #endif 37 38 private: 39 WebContents* web_contents_; 40 ContextMenuParams params_; 41 42 DISALLOW_COPY_AND_ASSIGN(ShellWebContentsViewDelegate); 43 }; 44 45 } // namespace content 46 47 #endif // CONTENT_SHELL_BROWSER_SHELL_WEB_CONTENTS_VIEW_DELEGATE_H_ 48