Chromium Code Reviews| 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/memory/scoped_ptr.h" | |
| 12 #include "content/public/browser/web_contents_view_mac_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 ChromeWebContentsViewMacDelegate | |
| 24 : public content::WebContentsViewMacDelegate { | |
| 25 public: | |
| 26 explicit ChromeWebContentsViewMacDelegate(content::WebContents* web_contents); | |
| 27 virtual ~ChromeWebContentsViewMacDelegate(); | |
| 28 | |
| 29 // Overridden from WebContentsViewMacDelegate: | |
| 30 virtual NSObject<RenderWidgetHostViewMacDelegate>* | |
| 31 CreateRenderWidgetHostViewDelegate( | |
| 32 RenderWidgetHost* render_widget_host) OVERRIDE; | |
| 33 virtual content::WebDragDestDelegate* DragDelegate() OVERRIDE; | |
| 34 virtual void ShowContextMenu(const ContextMenuParams& params) OVERRIDE; | |
| 35 virtual void NativeViewCreated(NSView* view) OVERRIDE; | |
| 36 virtual void NativeViewDestroyed(NSView* view) 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 }; | |
|
jochen (gone - plz use gerrit)
2012/02/03 00:13:33
you have scoped ptrs in here. shouldn't this be DI
Avi (use Gerrit)
2012/02/03 01:18:53
Done.
| |
| 48 | |
| 49 #endif // __OBJC__ | |
| 50 | |
| 51 namespace content { | |
| 52 class WebContents; | |
| 53 class WebContentsViewMacDelegate; | |
| 54 } | |
| 55 | |
| 56 namespace chrome_web_contents_view_mac_delegate { | |
| 57 // Creates a ChromeWebContentsViewMacDelegate. | |
| 58 content::WebContentsViewMacDelegate* CreateWebContentsViewMacDelegate( | |
|
jochen (gone - plz use gerrit)
2012/02/03 00:13:33
given the fancy namespace, why not just call it Cr
Avi (use Gerrit)
2012/02/03 01:18:53
This is the pattern we've used with tab_contents_v
| |
| 59 content::WebContents* web_contents); | |
| 60 } | |
| 61 | |
| 62 #endif // CHROME_BROWSER_TAB_CONTENTS_CHROME_WEB_CONTENTS_VIEW_MAC_DELEGATE_H_ | |
| OLD | NEW |