| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_VIEW_WIN_DELEGATE_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_VIEW_DELEGATE_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_VIEW_WIN_DELEGATE_H_ | 6 #define CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_VIEW_DELEGATE_H_ |
| 7 | 7 |
| 8 #if defined(OS_MACOSX) | 8 #if defined(__OBJC__) |
| 9 #import <Cocoa/Cocoa.h> | 9 #import <Cocoa/Cocoa.h> |
| 10 #endif | 10 #endif |
| 11 | 11 |
| 12 #include "content/common/content_export.h" | 12 #include "content/common/content_export.h" |
| 13 #include "ui/gfx/native_widget_types.h" | |
| 14 | 13 |
| 15 #if defined(OS_MACOSX) | 14 #if defined(__OBJC__) |
| 16 @protocol RenderWidgetHostViewMacDelegate; | 15 @protocol RenderWidgetHostViewMacDelegate; |
| 17 #endif | 16 #endif |
| 18 | 17 |
| 19 namespace gfx { | 18 namespace gfx { |
| 20 class Size; | 19 class Size; |
| 21 } | 20 } |
| 22 | 21 |
| 23 namespace ui { | |
| 24 class FocusStoreGtk; | |
| 25 } | |
| 26 | |
| 27 namespace content { | 22 namespace content { |
| 28 class RenderFrameHost; | 23 class RenderFrameHost; |
| 29 class RenderWidgetHost; | 24 class RenderWidgetHost; |
| 30 class WebDragDestDelegate; | 25 class WebDragDestDelegate; |
| 31 struct ContextMenuParams; | 26 struct ContextMenuParams; |
| 32 | 27 |
| 33 // This interface allows a client to extend the functionality of the | 28 // This interface allows a client to extend the functionality of the |
| 34 // WebContentsView implementation. | 29 // WebContentsView implementation. |
| 35 class CONTENT_EXPORT WebContentsViewDelegate { | 30 class CONTENT_EXPORT WebContentsViewDelegate { |
| 36 public: | 31 public: |
| 37 virtual ~WebContentsViewDelegate() {} | 32 virtual ~WebContentsViewDelegate(); |
| 38 | 33 |
| 39 // Returns a delegate to process drags not handled by content. | 34 // Returns a delegate to process drags not handled by content. |
| 40 virtual WebDragDestDelegate* GetDragDestDelegate() = 0; | 35 virtual WebDragDestDelegate* GetDragDestDelegate(); |
| 41 | 36 |
| 42 // Shows a context menu. | 37 // Shows a context menu. |
| 43 virtual void ShowContextMenu(RenderFrameHost* render_frame_host, | 38 virtual void ShowContextMenu(RenderFrameHost* render_frame_host, |
| 44 const ContextMenuParams& params) = 0; | 39 const ContextMenuParams& params); |
| 45 | 40 |
| 46 #if defined(USE_AURA) | 41 // These methods allow the embedder to intercept a WebContentsView's |
| 47 // These methods allow the embedder to intercept WebContentsViewWin's | 42 // implementation of these methods. See the WebContentsView interface |
| 48 // implementation of these WebContentsView methods. See the WebContentsView | 43 // documentation for more information about these methods. |
| 49 // interface documentation for more information about these methods. | 44 virtual void StoreFocus(); |
| 50 virtual void StoreFocus() = 0; | 45 virtual void RestoreFocus(); |
| 51 virtual void RestoreFocus() = 0; | 46 virtual bool Focus(); |
| 52 virtual bool Focus() = 0; | 47 virtual void TakeFocus(bool reverse); |
| 53 virtual void TakeFocus(bool reverse) = 0; | 48 virtual void SizeChanged(const gfx::Size& size); |
| 54 virtual void SizeChanged(const gfx::Size& size) = 0; | 49 |
| 55 #elif defined(OS_MACOSX) | |
| 56 // Returns a newly-created delegate for the RenderWidgetHostViewMac, to handle | 50 // Returns a newly-created delegate for the RenderWidgetHostViewMac, to handle |
| 57 // events on the responder chain. | 51 // events on the responder chain. |
| 52 #if defined(__OBJC__) |
| 58 virtual NSObject<RenderWidgetHostViewMacDelegate>* | 53 virtual NSObject<RenderWidgetHostViewMacDelegate>* |
| 59 CreateRenderWidgetHostViewDelegate( | 54 CreateRenderWidgetHostViewDelegate( |
| 60 RenderWidgetHost* render_widget_host) = 0; | 55 RenderWidgetHost* render_widget_host); |
| 56 #else |
| 57 virtual void* CreateRenderWidgetHostViewDelegate( |
| 58 RenderWidgetHost* render_widget_host); |
| 61 #endif | 59 #endif |
| 62 }; | 60 }; |
| 63 | 61 |
| 64 } // namespace content | 62 } // namespace content |
| 65 | 63 |
| 66 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_VIEW_WIN_DELEGATE_H_ | 64 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_VIEW_DELEGATE_H_ |
| OLD | NEW |