Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / ui / cocoa / tab_contents / chrome_web_contents_view_delegate_mac.h
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.
4
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_
7
8 #if defined(__OBJC__)
9
10 #include "base/basictypes.h"
11 #include "base/memory/scoped_ptr.h"
12 #include "content/public/browser/web_contents_view_delegate.h"
13
14 class RenderViewContextMenuMac;
15 class WebDragBookmarkHandlerMac;
16
17 namespace content {
18 class WebContents;
19 }
20
21 // A chrome/ specific class that extends WebContentsViewMac with features that
22 // live in chrome/.
23 class ChromeWebContentsViewDelegateMac
24     : public content::WebContentsViewDelegate {
25  public:
26   explicit ChromeWebContentsViewDelegateMac(content::WebContents* web_contents);
27   virtual ~ChromeWebContentsViewDelegateMac();
28
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;
37
38  private:
39   // The context menu. Callbacks are asynchronous so we need to keep it around.
40   scoped_ptr<RenderViewContextMenuMac> context_menu_;
41
42   // The chrome specific delegate that receives events from WebDragDestMac.
43   scoped_ptr<WebDragBookmarkHandlerMac> bookmark_handler_;
44
45   // The WebContents that owns the view.
46   content::WebContents* web_contents_;
47
48   DISALLOW_COPY_AND_ASSIGN(ChromeWebContentsViewDelegateMac);
49 };
50
51 #endif  // __OBJC__
52
53 #endif  // CHROME_BROWSER_UI_COCOA_TAB_CONTENTS_CHROME_WEB_CONTENTS_VIEW_DELEGATE_MAC_H_