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_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #import <Cocoa/Cocoa.h> | 9 #import <Cocoa/Cocoa.h> |
| 10 #include <list> | 10 #include <list> |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 59 id trackingRectOwner_; // (not retained) | 59 id trackingRectOwner_; // (not retained) |
| 60 void *trackingRectUserData_; | 60 void *trackingRectUserData_; |
| 61 NSTrackingRectTag lastToolTipTag_; | 61 NSTrackingRectTag lastToolTipTag_; |
| 62 scoped_nsobject<NSString> toolTip_; | 62 scoped_nsobject<NSString> toolTip_; |
| 63 | 63 |
| 64 // Is YES if there was a mouse-down as yet unbalanced with a mouse-up. | 64 // Is YES if there was a mouse-down as yet unbalanced with a mouse-up. |
| 65 BOOL hasOpenMouseDown_; | 65 BOOL hasOpenMouseDown_; |
| 66 | 66 |
| 67 NSWindow* lastWindow_; // weak | 67 NSWindow* lastWindow_; // weak |
| 68 | 68 |
| 69 // The cursor for the page. This is passed up from the renderer. | |
| 70 NSCursor* current_cursor_; | |
|
Avi (use Gerrit)
2012/05/24 15:14:49
Rather than the retains/releases in the .mm, you s
| |
| 71 | |
| 69 // Variables used by our implementaion of the NSTextInput protocol. | 72 // Variables used by our implementaion of the NSTextInput protocol. |
| 70 // An input method of Mac calls the methods of this protocol not only to | 73 // An input method of Mac calls the methods of this protocol not only to |
| 71 // notify an application of its status, but also to retrieve the status of | 74 // notify an application of its status, but also to retrieve the status of |
| 72 // the application. That is, an application cannot control an input method | 75 // the application. That is, an application cannot control an input method |
| 73 // directly. | 76 // directly. |
| 74 // This object keeps the status of a composition of the renderer and returns | 77 // This object keeps the status of a composition of the renderer and returns |
| 75 // it when an input method asks for it. | 78 // it when an input method asks for it. |
| 76 // We need to implement Objective-C methods for the NSTextInput protocol. On | 79 // We need to implement Objective-C methods for the NSTextInput protocol. On |
| 77 // the other hand, we need to implement a C++ method for an IPC-message | 80 // the other hand, we need to implement a C++ method for an IPC-message |
| 78 // handler which receives input-method events from the renderer. | 81 // handler which receives input-method events from the renderer. |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 147 - (void)cancelComposition; | 150 - (void)cancelComposition; |
| 148 // Confirm ongoing composition. | 151 // Confirm ongoing composition. |
| 149 - (void)confirmComposition; | 152 - (void)confirmComposition; |
| 150 // Enables or disables plugin IME. | 153 // Enables or disables plugin IME. |
| 151 - (void)setPluginImeActive:(BOOL)active; | 154 - (void)setPluginImeActive:(BOOL)active; |
| 152 // Updates the current plugin focus state. | 155 // Updates the current plugin focus state. |
| 153 - (void)pluginFocusChanged:(BOOL)focused forPlugin:(int)pluginId; | 156 - (void)pluginFocusChanged:(BOOL)focused forPlugin:(int)pluginId; |
| 154 // Evaluates the event in the context of plugin IME, if plugin IME is enabled. | 157 // Evaluates the event in the context of plugin IME, if plugin IME is enabled. |
| 155 // Returns YES if the event was handled. | 158 // Returns YES if the event was handled. |
| 156 - (BOOL)postProcessEventForPluginIme:(NSEvent*)event; | 159 - (BOOL)postProcessEventForPluginIme:(NSEvent*)event; |
| 157 | 160 - (void)updateCursor:(NSCursor*)cursor; |
| 158 @end | 161 @end |
| 159 | 162 |
| 160 /////////////////////////////////////////////////////////////////////////////// | 163 /////////////////////////////////////////////////////////////////////////////// |
| 161 // RenderWidgetHostViewMac | 164 // RenderWidgetHostViewMac |
| 162 // | 165 // |
| 163 // An object representing the "View" of a rendered web page. This object is | 166 // An object representing the "View" of a rendered web page. This object is |
| 164 // responsible for displaying the content of the web page, and integrating with | 167 // responsible for displaying the content of the web page, and integrating with |
| 165 // the Cocoa view system. It is the implementation of the RenderWidgetHostView | 168 // the Cocoa view system. It is the implementation of the RenderWidgetHostView |
| 166 // that the cross-platform RenderWidgetHost object uses | 169 // that the cross-platform RenderWidgetHost object uses |
| 167 // to display the data. | 170 // to display the data. |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 375 friend class content::RenderWidgetHostView; | 378 friend class content::RenderWidgetHostView; |
| 376 | 379 |
| 377 // The view will associate itself with the given widget. The native view must | 380 // The view will associate itself with the given widget. The native view must |
| 378 // be hooked up immediately to the view hierarchy, or else when it is | 381 // be hooked up immediately to the view hierarchy, or else when it is |
| 379 // deleted it will delete this out from under the caller. | 382 // deleted it will delete this out from under the caller. |
| 380 explicit RenderWidgetHostViewMac(content::RenderWidgetHost* widget); | 383 explicit RenderWidgetHostViewMac(content::RenderWidgetHost* widget); |
| 381 | 384 |
| 382 // Returns whether this render view is a popup (autocomplete window). | 385 // Returns whether this render view is a popup (autocomplete window). |
| 383 bool IsPopup() const; | 386 bool IsPopup() const; |
| 384 | 387 |
| 385 // Updates the display cursor if the current event is over the view's window. | |
| 386 void UpdateCursorIfNecessary(); | |
| 387 | |
| 388 // Shuts down the render_widget_host_. This is a separate function so we can | 388 // Shuts down the render_widget_host_. This is a separate function so we can |
| 389 // invoke it from the message loop. | 389 // invoke it from the message loop. |
| 390 void ShutdownHost(); | 390 void ShutdownHost(); |
| 391 | 391 |
| 392 // Called when a GPU SwapBuffers is received. | 392 // Called when a GPU SwapBuffers is received. |
| 393 void GotAcceleratedFrame(); | 393 void GotAcceleratedFrame(); |
| 394 // Called when a software DIB is received. | 394 // Called when a software DIB is received. |
| 395 void GotSoftwareFrame(); | 395 void GotSoftwareFrame(); |
| 396 | 396 |
| 397 // The associated view. This is weak and is inserted into the view hierarchy | 397 // The associated view. This is weak and is inserted into the view hierarchy |
| 398 // to own this RenderWidgetHostViewMac object. | 398 // to own this RenderWidgetHostViewMac object. |
| 399 RenderWidgetHostViewCocoa* cocoa_view_; | 399 RenderWidgetHostViewCocoa* cocoa_view_; |
| 400 | 400 |
| 401 // The cursor for the page. This is passed up from the renderer. | |
| 402 WebCursor current_cursor_; | |
| 403 | |
| 404 // Indicates if the page is loading. | 401 // Indicates if the page is loading. |
| 405 bool is_loading_; | 402 bool is_loading_; |
| 406 | 403 |
| 407 // true if the View is not visible. | 404 // true if the View is not visible. |
| 408 bool is_hidden_; | 405 bool is_hidden_; |
| 409 | 406 |
| 410 // The text to be shown in the tooltip, supplied by the renderer. | 407 // The text to be shown in the tooltip, supplied by the renderer. |
| 411 string16 tooltip_text_; | 408 string16 tooltip_text_; |
| 412 | 409 |
| 413 // Factory used to safely scope delayed calls to ShutdownHost(). | 410 // Factory used to safely scope delayed calls to ShutdownHost(). |
| 414 base::WeakPtrFactory<RenderWidgetHostViewMac> weak_factory_; | 411 base::WeakPtrFactory<RenderWidgetHostViewMac> weak_factory_; |
| 415 | 412 |
| 416 // selected text on the renderer. | 413 // selected text on the renderer. |
| 417 std::string selected_text_; | 414 std::string selected_text_; |
| 418 | 415 |
| 419 // The fullscreen window used for pepper flash. | 416 // The fullscreen window used for pepper flash. |
| 420 scoped_nsobject<NSWindow> pepper_fullscreen_window_; | 417 scoped_nsobject<NSWindow> pepper_fullscreen_window_; |
| 421 scoped_nsobject<FullscreenWindowManager> fullscreen_window_manager_; | 418 scoped_nsobject<FullscreenWindowManager> fullscreen_window_manager_; |
| 422 | 419 |
| 423 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewMac); | 420 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewMac); |
| 424 }; | 421 }; |
| 425 | 422 |
| 426 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ | 423 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ |
| OLD | NEW |