| OLD | NEW |
| (Empty) | |
| 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_TAB_CONTENTS_CHROME_WEB_CONTENTS_VIEW_MAC_DELEGATE_H_ |
| 6 #define CHROME_BROWSER_TAB_CONTENTS_CHROME_WEB_CONTENTS_VIEW_MAC_DELEGATE_H_ |
| 7 #pragma once |
| 8 |
| 9 #if defined(__OBJC__) |
| 10 |
| 11 #include "base/basictypes.h" |
| 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "content/public/browser/web_contents_view_mac_delegate.h" |
| 14 |
| 15 class RenderViewContextMenuMac; |
| 16 class WebDragBookmarkHandlerMac; |
| 17 |
| 18 namespace content { |
| 19 class WebContents; |
| 20 } |
| 21 |
| 22 // A chrome/ specific class that extends WebContentsViewMac with features that |
| 23 // live in chrome/. |
| 24 class ChromeWebContentsViewMacDelegate |
| 25 : public content::WebContentsViewMacDelegate { |
| 26 public: |
| 27 explicit ChromeWebContentsViewMacDelegate(content::WebContents* web_contents); |
| 28 virtual ~ChromeWebContentsViewMacDelegate(); |
| 29 |
| 30 // Overridden from WebContentsViewMacDelegate: |
| 31 virtual NSObject<RenderWidgetHostViewMacDelegate>* |
| 32 CreateRenderWidgetHostViewDelegate( |
| 33 RenderWidgetHost* render_widget_host) OVERRIDE; |
| 34 virtual content::WebDragDestDelegate* DragDelegate() OVERRIDE; |
| 35 virtual void ShowContextMenu(const ContextMenuParams& params) OVERRIDE; |
| 36 virtual void NativeViewCreated(NSView* view) OVERRIDE; |
| 37 virtual void NativeViewDestroyed(NSView* view) OVERRIDE; |
| 38 |
| 39 private: |
| 40 // The context menu. Callbacks are asynchronous so we need to keep it around. |
| 41 scoped_ptr<RenderViewContextMenuMac> context_menu_; |
| 42 |
| 43 // The chrome specific delegate that receives events from WebDragDestMac. |
| 44 scoped_ptr<WebDragBookmarkHandlerMac> bookmark_handler_; |
| 45 |
| 46 // The WebContents that owns the view. |
| 47 content::WebContents* web_contents_; |
| 48 |
| 49 DISALLOW_COPY_AND_ASSIGN(ChromeWebContentsViewMacDelegate); |
| 50 }; |
| 51 |
| 52 #endif // __OBJC__ |
| 53 |
| 54 namespace content { |
| 55 class WebContents; |
| 56 class WebContentsViewMacDelegate; |
| 57 } |
| 58 |
| 59 namespace chrome_web_contents_view_mac_delegate { |
| 60 // Creates a ChromeWebContentsViewMacDelegate. |
| 61 content::WebContentsViewMacDelegate* CreateWebContentsViewMacDelegate( |
| 62 content::WebContents* web_contents); |
| 63 } |
| 64 |
| 65 #endif // CHROME_BROWSER_TAB_CONTENTS_CHROME_WEB_CONTENTS_VIEW_MAC_DELEGATE_H_ |
| OLD | NEW |