Chromium Code Reviews| 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_WIN_DELEGATE_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_VIEW_WIN_DELEGATE_H_ | 6 #define CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_VIEW_WIN_DELEGATE_H_ |
| 7 | 7 |
| 8 #if defined(OS_MACOSX) | 8 #if defined(OS_MACOSX) |
| 9 #import <Cocoa/Cocoa.h> | 9 #import <Cocoa/Cocoa.h> |
| 10 #endif | 10 #endif |
| 11 | 11 |
| 12 #include "base/callback_forward.h" | |
| 12 #include "content/common/content_export.h" | 13 #include "content/common/content_export.h" |
| 14 #include "ui/gfx/geometry/rect.h" | |
| 13 #include "ui/gfx/native_widget_types.h" | 15 #include "ui/gfx/native_widget_types.h" |
| 14 | 16 |
| 15 #if defined(OS_MACOSX) | 17 #if defined(OS_MACOSX) |
| 16 @protocol RenderWidgetHostViewMacDelegate; | 18 @protocol RenderWidgetHostViewMacDelegate; |
| 17 #endif | 19 #endif |
| 18 | 20 |
| 19 namespace gfx { | 21 namespace gfx { |
| 20 class Size; | 22 class Size; |
| 21 } | 23 } |
| 22 | 24 |
| 23 namespace ui { | 25 namespace ui { |
| 24 class FocusStoreGtk; | 26 class FocusStoreGtk; |
| 27 class GestureEvent; | |
| 25 } | 28 } |
| 26 | 29 |
| 27 namespace content { | 30 namespace content { |
| 28 class RenderFrameHost; | 31 class RenderFrameHost; |
| 29 class RenderWidgetHost; | 32 class RenderWidgetHost; |
| 30 class WebDragDestDelegate; | 33 class WebDragDestDelegate; |
| 31 struct ContextMenuParams; | 34 struct ContextMenuParams; |
| 32 | 35 |
| 33 // This interface allows a client to extend the functionality of the | 36 // This interface allows a client to extend the functionality of the |
| 34 // WebContentsView implementation. | 37 // WebContentsView implementation. |
| 35 class CONTENT_EXPORT WebContentsViewDelegate { | 38 class CONTENT_EXPORT WebContentsViewDelegate { |
| 36 public: | 39 public: |
| 37 virtual ~WebContentsViewDelegate() {} | 40 virtual ~WebContentsViewDelegate() {} |
| 38 | 41 |
| 39 // Returns a delegate to process drags not handled by content. | 42 // Returns a delegate to process drags not handled by content. |
| 40 virtual WebDragDestDelegate* GetDragDestDelegate() = 0; | 43 virtual WebDragDestDelegate* GetDragDestDelegate() = 0; |
| 41 | 44 |
| 42 // Shows a context menu. | 45 // Shows a context menu. |
| 43 virtual void ShowContextMenu(RenderFrameHost* render_frame_host, | 46 virtual void ShowContextMenu(RenderFrameHost* render_frame_host, |
| 44 const ContextMenuParams& params) = 0; | 47 const ContextMenuParams& params) = 0; |
| 45 | 48 |
| 49 #if defined(OS_WIN) | |
|
sky
2014/08/04 20:05:20
OS_WIN->TOOLKIT_VIEWS
luken
2014/09/11 01:07:28
Done.
| |
| 50 // Shows a popup window containing the |zoomed_bitmap| of web content with | |
| 51 // more than one link, allowing the user to more easily select which link | |
| 52 // they were trying to touch. |target_rect| is the rectangle in DIPs in the | |
| 53 // coordinate system of |content| that has been scaled up in |zoomed_bitmap|. | |
| 54 // Should the popup receive any gesture events they should be translated back | |
| 55 // to the coordinate system of |content| and then provided to the |callback| | |
| 56 // for forwarding on to the original scale web content. | |
| 57 typedef base::Callback<void(ui::GestureEvent* event)> GestureCallback; | |
| 58 virtual void ShowDisambiguationPopup(const gfx::Rect& target_rect, | |
| 59 const SkBitmap& zoomed_bitmap, | |
| 60 const gfx::NativeView content, | |
| 61 const GestureCallback& callback) = 0; | |
| 62 // Hides the link disambiguation popup window if it is showing, otherwise does | |
| 63 // nothing. | |
| 64 virtual void HideDisambiguationPopup() = 0; | |
| 65 #endif | |
| 66 | |
| 46 #if defined(USE_AURA) | 67 #if defined(USE_AURA) |
| 47 // These methods allow the embedder to intercept WebContentsViewWin's | 68 // These methods allow the embedder to intercept WebContentsViewWin's |
| 48 // implementation of these WebContentsView methods. See the WebContentsView | 69 // implementation of these WebContentsView methods. See the WebContentsView |
| 49 // interface documentation for more information about these methods. | 70 // interface documentation for more information about these methods. |
| 50 virtual void StoreFocus() = 0; | 71 virtual void StoreFocus() = 0; |
| 51 virtual void RestoreFocus() = 0; | 72 virtual void RestoreFocus() = 0; |
| 52 virtual bool Focus() = 0; | 73 virtual bool Focus() = 0; |
| 53 virtual void TakeFocus(bool reverse) = 0; | 74 virtual void TakeFocus(bool reverse) = 0; |
| 54 virtual void SizeChanged(const gfx::Size& size) = 0; | 75 virtual void SizeChanged(const gfx::Size& size) = 0; |
| 55 #elif defined(OS_MACOSX) | 76 #elif defined(OS_MACOSX) |
| 56 // Returns a newly-created delegate for the RenderWidgetHostViewMac, to handle | 77 // Returns a newly-created delegate for the RenderWidgetHostViewMac, to handle |
| 57 // events on the responder chain. | 78 // events on the responder chain. |
| 58 virtual NSObject<RenderWidgetHostViewMacDelegate>* | 79 virtual NSObject<RenderWidgetHostViewMacDelegate>* |
| 59 CreateRenderWidgetHostViewDelegate( | 80 CreateRenderWidgetHostViewDelegate( |
| 60 RenderWidgetHost* render_widget_host) = 0; | 81 RenderWidgetHost* render_widget_host) = 0; |
| 61 #endif | 82 #endif |
| 62 }; | 83 }; |
| 63 | 84 |
| 64 } // namespace content | 85 } // namespace content |
| 65 | 86 |
| 66 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_VIEW_WIN_DELEGATE_H_ | 87 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_VIEW_WIN_DELEGATE_H_ |
| OLD | NEW |