1 // Copyright (c) 2012 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.
5 #ifndef CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_VIEW_WIN_DELEGATE_H_
6 #define CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_VIEW_WIN_DELEGATE_H_
9 #import <Cocoa/Cocoa.h>
12 #include "content/common/content_export.h"
13 #include "ui/gfx/native_widget_types.h"
15 #if defined(OS_MACOSX)
16 @protocol RenderWidgetHostViewMacDelegate
;
28 class RenderFrameHost
;
29 class RenderWidgetHost
;
30 class WebDragDestDelegate
;
31 struct ContextMenuParams
;
33 // This interface allows a client to extend the functionality of the
34 // WebContentsView implementation.
35 class CONTENT_EXPORT WebContentsViewDelegate
{
37 virtual ~WebContentsViewDelegate() {}
39 // Returns a delegate to process drags not handled by content.
40 virtual WebDragDestDelegate
* GetDragDestDelegate() = 0;
42 // Shows a context menu.
43 virtual void ShowContextMenu(RenderFrameHost
* render_frame_host
,
44 const ContextMenuParams
& params
) = 0;
47 // These methods allow the embedder to intercept WebContentsViewWin's
48 // implementation of these WebContentsView methods. See the WebContentsView
49 // interface documentation for more information about these methods.
50 virtual void StoreFocus() = 0;
51 virtual void RestoreFocus() = 0;
52 virtual bool Focus() = 0;
53 virtual void TakeFocus(bool reverse
) = 0;
54 virtual void SizeChanged(const gfx::Size
& size
) = 0;
55 #elif defined(OS_MACOSX)
56 // Returns a newly-created delegate for the RenderWidgetHostViewMac, to handle
57 // events on the responder chain.
58 virtual NSObject
<RenderWidgetHostViewMacDelegate
>*
59 CreateRenderWidgetHostViewDelegate(
60 RenderWidgetHost
* render_widget_host
) = 0;
64 } // namespace content
66 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_VIEW_WIN_DELEGATE_H_