Chromium Code Reviews| Index: chrome/browser/tab_contents/chrome_web_contents_view_mac_delegate.h |
| diff --git a/chrome/browser/tab_contents/chrome_web_contents_view_mac_delegate.h b/chrome/browser/tab_contents/chrome_web_contents_view_mac_delegate.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..33c20da09c199e143008ec8348131bc0a826ffa6 |
| --- /dev/null |
| +++ b/chrome/browser/tab_contents/chrome_web_contents_view_mac_delegate.h |
| @@ -0,0 +1,62 @@ |
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROME_BROWSER_TAB_CONTENTS_CHROME_WEB_CONTENTS_VIEW_MAC_DELEGATE_H_ |
| +#define CHROME_BROWSER_TAB_CONTENTS_CHROME_WEB_CONTENTS_VIEW_MAC_DELEGATE_H_ |
| +#pragma once |
| + |
| +#if defined(__OBJC__) |
| + |
| +#include "base/memory/scoped_ptr.h" |
| +#include "content/public/browser/web_contents_view_mac_delegate.h" |
| + |
| +class RenderViewContextMenuMac; |
| +class WebDragBookmarkHandlerMac; |
| + |
| +namespace content { |
| +class WebContents; |
| +} |
| + |
| +// A chrome/ specific class that extends WebContentsViewMac with features that |
| +// live in chrome/. |
| +class ChromeWebContentsViewMacDelegate |
| + : public content::WebContentsViewMacDelegate { |
| + public: |
| + explicit ChromeWebContentsViewMacDelegate(content::WebContents* web_contents); |
| + virtual ~ChromeWebContentsViewMacDelegate(); |
| + |
| + // Overridden from WebContentsViewMacDelegate: |
| + virtual NSObject<RenderWidgetHostViewMacDelegate>* |
| + CreateRenderWidgetHostViewDelegate( |
| + RenderWidgetHost* render_widget_host) OVERRIDE; |
| + virtual content::WebDragDestDelegate* DragDelegate() OVERRIDE; |
| + virtual void ShowContextMenu(const ContextMenuParams& params) OVERRIDE; |
| + virtual void NativeViewCreated(NSView* view) OVERRIDE; |
| + virtual void NativeViewDestroyed(NSView* view) OVERRIDE; |
| + |
| + private: |
| + // The context menu. Callbacks are asynchronous so we need to keep it around. |
| + scoped_ptr<RenderViewContextMenuMac> context_menu_; |
| + |
| + // The chrome specific delegate that receives events from WebDragDestMac. |
| + scoped_ptr<WebDragBookmarkHandlerMac> bookmark_handler_; |
| + |
| + // The WebContents that owns the view. |
| + content::WebContents* web_contents_; |
| +}; |
|
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.
|
| + |
| +#endif // __OBJC__ |
| + |
| +namespace content { |
| +class WebContents; |
| +class WebContentsViewMacDelegate; |
| +} |
| + |
| +namespace chrome_web_contents_view_mac_delegate { |
| +// Creates a ChromeWebContentsViewMacDelegate. |
| +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
|
| + content::WebContents* web_contents); |
| +} |
| + |
| +#endif // CHROME_BROWSER_TAB_CONTENTS_CHROME_WEB_CONTENTS_VIEW_MAC_DELEGATE_H_ |