| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ | 5 #ifndef CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ |
| 6 #define CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ | 6 #define CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ |
| 7 | 7 |
| 8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
| 9 #import <QuartzCore/CALayer.h> | 9 #import <QuartzCore/CALayer.h> |
| 10 | 10 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 NSTrackingRectTag lastToolTipTag_; | 45 NSTrackingRectTag lastToolTipTag_; |
| 46 scoped_nsobject<NSString> toolTip_; | 46 scoped_nsobject<NSString> toolTip_; |
| 47 | 47 |
| 48 // Set to YES if insertText: or insertNewline: get called. | 48 // Set to YES if insertText: or insertNewline: get called. |
| 49 BOOL textInserted_; | 49 BOOL textInserted_; |
| 50 | 50 |
| 51 // Keep current key event when keyEvent: gets called. It's used in | 51 // Keep current key event when keyEvent: gets called. It's used in |
| 52 // insertText: and insertNewline: to synthesize the corresponding Char event. | 52 // insertText: and insertNewline: to synthesize the corresponding Char event. |
| 53 scoped_nsobject<NSEvent> currentKeyEvent_; | 53 scoped_nsobject<NSEvent> currentKeyEvent_; |
| 54 NSWindow* lastWindow_; // weak | 54 NSWindow* lastWindow_; // weak |
| 55 |
| 56 // The Core Animation layer, if any, hosting the accelerated plugins' output. |
| 57 scoped_nsobject<CALayer> accelerated_plugin_layer_; |
| 55 } | 58 } |
| 56 | 59 |
| 57 - (void)setCanBeKeyView:(BOOL)can; | 60 - (void)setCanBeKeyView:(BOOL)can; |
| 58 - (void)setCloseOnDeactivate:(BOOL)b; | 61 - (void)setCloseOnDeactivate:(BOOL)b; |
| 59 - (void)setToolTipAtMousePoint:(NSString *)string; | 62 - (void)setToolTipAtMousePoint:(NSString *)string; |
| 63 // Makes sure that the initial layer setup for accelerated plugin drawing has |
| 64 // been done. Can be called multiple times. |
| 65 - (void)ensureAcceleratedPluginLayer; |
| 66 // Triggers a refresh of the accelerated plugin layer; should be called whenever |
| 67 // the shared surface for one of the plugins is updated. |
| 68 - (void)drawAcceleratedPluginLayer; |
| 60 @end | 69 @end |
| 61 | 70 |
| 62 /////////////////////////////////////////////////////////////////////////////// | 71 /////////////////////////////////////////////////////////////////////////////// |
| 63 // RenderWidgetHostViewMac | 72 // RenderWidgetHostViewMac |
| 64 // | 73 // |
| 65 // An object representing the "View" of a rendered web page. This object is | 74 // An object representing the "View" of a rendered web page. This object is |
| 66 // responsible for displaying the content of the web page, and integrating with | 75 // responsible for displaying the content of the web page, and integrating with |
| 67 // the Cocoa view system. It is the implementation of the RenderWidgetHostView | 76 // the Cocoa view system. It is the implementation of the RenderWidgetHostView |
| 68 // that the cross-platform RenderWidgetHost object uses | 77 // that the cross-platform RenderWidgetHost object uses |
| 69 // to display the data. | 78 // to display the data. |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 int32 height, | 141 int32 height, |
| 133 uint64 io_surface_identifier); | 142 uint64 io_surface_identifier); |
| 134 virtual void AcceleratedSurfaceSetTransportDIB( | 143 virtual void AcceleratedSurfaceSetTransportDIB( |
| 135 gfx::PluginWindowHandle window, | 144 gfx::PluginWindowHandle window, |
| 136 int32 width, | 145 int32 width, |
| 137 int32 height, | 146 int32 height, |
| 138 TransportDIB::Handle transport_dib); | 147 TransportDIB::Handle transport_dib); |
| 139 virtual void AcceleratedSurfaceBuffersSwapped(gfx::PluginWindowHandle window); | 148 virtual void AcceleratedSurfaceBuffersSwapped(gfx::PluginWindowHandle window); |
| 140 // Draws the current GPU-accelerated plug-in instances into the given context. | 149 // Draws the current GPU-accelerated plug-in instances into the given context. |
| 141 virtual void DrawAcceleratedSurfaceInstances(CGLContextObj context); | 150 virtual void DrawAcceleratedSurfaceInstances(CGLContextObj context); |
| 151 // Informs the plug-in instances that their drawing context has changed. |
| 152 virtual void AcceleratedSurfaceContextChanged(); |
| 153 |
| 142 virtual void SetVisuallyDeemphasized(bool deemphasized); | 154 virtual void SetVisuallyDeemphasized(bool deemphasized); |
| 143 | 155 |
| 144 void KillSelf(); | 156 void KillSelf(); |
| 145 | 157 |
| 146 void set_parent_view(BaseView* parent_view) { parent_view_ = parent_view; } | 158 void set_parent_view(BaseView* parent_view) { parent_view_ = parent_view; } |
| 147 | 159 |
| 148 // These member variables should be private, but the associated ObjC class | 160 // These member variables should be private, but the associated ObjC class |
| 149 // needs access to them and can't be made a friend. | 161 // needs access to them and can't be made a friend. |
| 150 | 162 |
| 151 // The associated Model. Can be NULL if Destroy() is called when | 163 // The associated Model. Can be NULL if Destroy() is called when |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 // To create a Char event in NSTextInput methods, we save the latest state | 212 // To create a Char event in NSTextInput methods, we save the latest state |
| 201 // of modifier keys when we receive it. | 213 // of modifier keys when we receive it. |
| 202 int im_modifiers_; | 214 int im_modifiers_; |
| 203 | 215 |
| 204 // Represents the cursor position in this view coordinate. | 216 // Represents the cursor position in this view coordinate. |
| 205 // The renderer sends the cursor position through an IPC message. | 217 // The renderer sends the cursor position through an IPC message. |
| 206 // We save the latest cursor position here and return it when an input | 218 // We save the latest cursor position here and return it when an input |
| 207 // methods needs it. | 219 // methods needs it. |
| 208 NSRect im_caret_rect_; | 220 NSRect im_caret_rect_; |
| 209 | 221 |
| 210 // The Core Animation layer, if any, hosting the GPU plugins' output. | |
| 211 scoped_nsobject<CALayer> gpu_plugin_layer_; | |
| 212 | |
| 213 private: | 222 private: |
| 214 // Updates the display cursor to the current cursor if the cursor is over this | 223 // Updates the display cursor to the current cursor if the cursor is over this |
| 215 // render view. | 224 // render view. |
| 216 void UpdateCursorIfOverSelf(); | 225 void UpdateCursorIfOverSelf(); |
| 217 | 226 |
| 218 // Shuts down the render_widget_host_. This is a separate function so we can | 227 // Shuts down the render_widget_host_. This is a separate function so we can |
| 219 // invoke it from the message loop. | 228 // invoke it from the message loop. |
| 220 void ShutdownHost(); | 229 void ShutdownHost(); |
| 221 | 230 |
| 222 // The associated view. This is weak and is inserted into the view hierarchy | 231 // The associated view. This is weak and is inserted into the view hierarchy |
| (...skipping 26 matching lines...) Expand all Loading... |
| 249 // Used for positioning a popup menu. | 258 // Used for positioning a popup menu. |
| 250 BaseView* parent_view_; | 259 BaseView* parent_view_; |
| 251 | 260 |
| 252 // Helper class for managing instances of accelerated plug-ins. | 261 // Helper class for managing instances of accelerated plug-ins. |
| 253 AcceleratedSurfaceContainerManagerMac plugin_container_manager_; | 262 AcceleratedSurfaceContainerManagerMac plugin_container_manager_; |
| 254 | 263 |
| 255 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewMac); | 264 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewMac); |
| 256 }; | 265 }; |
| 257 | 266 |
| 258 #endif // CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ | 267 #endif // CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ |
| OLD | NEW |