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 CHROME_BROWSER_UI_COCOA_TAB_CONTENTS_CHROME_WEB_CONTENTS_VIEW_DELEGATE_MAC_H_
6 #define CHROME_BROWSER_UI_COCOA_TAB_CONTENTS_CHROME_WEB_CONTENTS_VIEW_DELEGATE_MAC_H_
10 #include "base/basictypes.h"
11 #include "base/memory/scoped_ptr.h"
12 #include "content/public/browser/web_contents_view_delegate.h"
14 class RenderViewContextMenuMac;
15 class WebDragBookmarkHandlerMac;
21 // A chrome/ specific class that extends WebContentsViewMac with features that
23 class ChromeWebContentsViewDelegateMac
24 : public content::WebContentsViewDelegate {
26 explicit ChromeWebContentsViewDelegateMac(content::WebContents* web_contents);
27 virtual ~ChromeWebContentsViewDelegateMac();
29 // Overridden from WebContentsViewDelegate:
30 virtual NSObject<RenderWidgetHostViewMacDelegate>*
31 CreateRenderWidgetHostViewDelegate(
32 content::RenderWidgetHost* render_widget_host) OVERRIDE;
33 virtual content::WebDragDestDelegate* GetDragDestDelegate() OVERRIDE;
34 virtual void ShowContextMenu(
35 content::RenderFrameHost* render_frame_host,
36 const content::ContextMenuParams& params) OVERRIDE;
39 // The context menu. Callbacks are asynchronous so we need to keep it around.
40 scoped_ptr<RenderViewContextMenuMac> context_menu_;
42 // The chrome specific delegate that receives events from WebDragDestMac.
43 scoped_ptr<WebDragBookmarkHandlerMac> bookmark_handler_;
45 // The WebContents that owns the view.
46 content::WebContents* web_contents_;
48 DISALLOW_COPY_AND_ASSIGN(ChromeWebContentsViewDelegateMac);
53 #endif // CHROME_BROWSER_UI_COCOA_TAB_CONTENTS_CHROME_WEB_CONTENTS_VIEW_DELEGATE_MAC_H_