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(TOOLKIT_GTK) | 8 #if defined(OS_MACOSX) |
9 #include <gtk/gtk.h> | |
10 #elif defined(OS_MACOSX) | |
11 #import <Cocoa/Cocoa.h> | 9 #import <Cocoa/Cocoa.h> |
12 #endif | 10 #endif |
13 | 11 |
14 #include "content/common/content_export.h" | 12 #include "content/common/content_export.h" |
15 #include "ui/gfx/native_widget_types.h" | 13 #include "ui/gfx/native_widget_types.h" |
16 | 14 |
17 #if defined(OS_MACOSX) | 15 #if defined(OS_MACOSX) |
18 @protocol RenderWidgetHostViewMacDelegate; | 16 @protocol RenderWidgetHostViewMacDelegate; |
19 #endif | 17 #endif |
20 | 18 |
(...skipping 26 matching lines...) Expand all Loading... |
47 | 45 |
48 #if defined(OS_WIN) || defined(USE_AURA) | 46 #if defined(OS_WIN) || defined(USE_AURA) |
49 // These methods allow the embedder to intercept WebContentsViewWin's | 47 // These methods allow the embedder to intercept WebContentsViewWin's |
50 // implementation of these WebContentsView methods. See the WebContentsView | 48 // implementation of these WebContentsView methods. See the WebContentsView |
51 // interface documentation for more information about these methods. | 49 // interface documentation for more information about these methods. |
52 virtual void StoreFocus() = 0; | 50 virtual void StoreFocus() = 0; |
53 virtual void RestoreFocus() = 0; | 51 virtual void RestoreFocus() = 0; |
54 virtual bool Focus() = 0; | 52 virtual bool Focus() = 0; |
55 virtual void TakeFocus(bool reverse) = 0; | 53 virtual void TakeFocus(bool reverse) = 0; |
56 virtual void SizeChanged(const gfx::Size& size) = 0; | 54 virtual void SizeChanged(const gfx::Size& size) = 0; |
57 #elif defined(TOOLKIT_GTK) | |
58 // Initializes the WebContentsViewDelegate. | |
59 virtual void Initialize(GtkWidget* expanded_container, | |
60 ui::FocusStoreGtk* focus_store) = 0; | |
61 | |
62 // Returns the top widget that contains |view| passed in from WrapView. This | |
63 // is exposed through WebContentsViewGtk::GetNativeView() when a wrapper is | |
64 // supplied to a WebContentsViewGtk. | |
65 virtual gfx::NativeView GetNativeView() const = 0; | |
66 | |
67 // Handles a focus event from the renderer process. | |
68 virtual void Focus() = 0; | |
69 | |
70 // Gives the delegate a first chance at focus events from our render widget | |
71 // host, before the main view invokes its default behaviour. Returns TRUE if | |
72 // |return_value| has been set and that value should be returned to GTK+. | |
73 virtual gboolean OnNativeViewFocusEvent(GtkWidget* widget, | |
74 GtkDirectionType type, | |
75 gboolean* return_value) = 0; | |
76 #elif defined(OS_MACOSX) | 55 #elif defined(OS_MACOSX) |
77 // Returns a newly-created delegate for the RenderWidgetHostViewMac, to handle | 56 // Returns a newly-created delegate for the RenderWidgetHostViewMac, to handle |
78 // events on the responder chain. | 57 // events on the responder chain. |
79 virtual NSObject<RenderWidgetHostViewMacDelegate>* | 58 virtual NSObject<RenderWidgetHostViewMacDelegate>* |
80 CreateRenderWidgetHostViewDelegate( | 59 CreateRenderWidgetHostViewDelegate( |
81 RenderWidgetHost* render_widget_host) = 0; | 60 RenderWidgetHost* render_widget_host) = 0; |
82 #endif | 61 #endif |
83 }; | 62 }; |
84 | 63 |
85 } // namespace content | 64 } // namespace content |
86 | 65 |
87 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_VIEW_WIN_DELEGATE_H_ | 66 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_VIEW_WIN_DELEGATE_H_ |
OLD | NEW |