Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(551)

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_mac.h

Issue 10450012: Apply a CursorRect to the extent of the render widget view for web page cursors. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Build fix -- trivial namespace update Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | content/browser/renderer_host/render_widget_host_view_mac.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 scoped_nsobject<NSCursor> currentCursor_;
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
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 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 friend class content::RenderWidgetHostView; 384 friend class content::RenderWidgetHostView;
382 385
383 // The view will associate itself with the given widget. The native view must 386 // The view will associate itself with the given widget. The native view must
384 // be hooked up immediately to the view hierarchy, or else when it is 387 // be hooked up immediately to the view hierarchy, or else when it is
385 // deleted it will delete this out from under the caller. 388 // deleted it will delete this out from under the caller.
386 explicit RenderWidgetHostViewMac(content::RenderWidgetHost* widget); 389 explicit RenderWidgetHostViewMac(content::RenderWidgetHost* widget);
387 390
388 // Returns whether this render view is a popup (autocomplete window). 391 // Returns whether this render view is a popup (autocomplete window).
389 bool IsPopup() const; 392 bool IsPopup() const;
390 393
391 // Updates the display cursor if the current event is over the view's window.
392 void UpdateCursorIfNecessary();
393
394 // Shuts down the render_widget_host_. This is a separate function so we can 394 // Shuts down the render_widget_host_. This is a separate function so we can
395 // invoke it from the message loop. 395 // invoke it from the message loop.
396 void ShutdownHost(); 396 void ShutdownHost();
397 397
398 // Called when a GPU SwapBuffers is received. 398 // Called when a GPU SwapBuffers is received.
399 void GotAcceleratedFrame(); 399 void GotAcceleratedFrame();
400 // Called when a software DIB is received. 400 // Called when a software DIB is received.
401 void GotSoftwareFrame(); 401 void GotSoftwareFrame();
402 402
403 // The associated view. This is weak and is inserted into the view hierarchy 403 // The associated view. This is weak and is inserted into the view hierarchy
404 // to own this RenderWidgetHostViewMac object. 404 // to own this RenderWidgetHostViewMac object.
405 RenderWidgetHostViewCocoa* cocoa_view_; 405 RenderWidgetHostViewCocoa* cocoa_view_;
406 406
407 // The cursor for the page. This is passed up from the renderer.
408 WebCursor current_cursor_;
409
410 // Indicates if the page is loading. 407 // Indicates if the page is loading.
411 bool is_loading_; 408 bool is_loading_;
412 409
413 // true if the View is not visible. 410 // true if the View is not visible.
414 bool is_hidden_; 411 bool is_hidden_;
415 412
416 // The text to be shown in the tooltip, supplied by the renderer. 413 // The text to be shown in the tooltip, supplied by the renderer.
417 string16 tooltip_text_; 414 string16 tooltip_text_;
418 415
419 // Factory used to safely scope delayed calls to ShutdownHost(). 416 // Factory used to safely scope delayed calls to ShutdownHost().
420 base::WeakPtrFactory<RenderWidgetHostViewMac> weak_factory_; 417 base::WeakPtrFactory<RenderWidgetHostViewMac> weak_factory_;
421 418
422 // selected text on the renderer. 419 // selected text on the renderer.
423 std::string selected_text_; 420 std::string selected_text_;
424 421
425 // The fullscreen window used for pepper flash. 422 // The fullscreen window used for pepper flash.
426 scoped_nsobject<NSWindow> pepper_fullscreen_window_; 423 scoped_nsobject<NSWindow> pepper_fullscreen_window_;
427 scoped_nsobject<FullscreenWindowManager> fullscreen_window_manager_; 424 scoped_nsobject<FullscreenWindowManager> fullscreen_window_manager_;
428 425
429 // List of pending swaps for deferred acking: 426 // List of pending swaps for deferred acking:
430 // pairs of (route_id, gpu_host_id). 427 // pairs of (route_id, gpu_host_id).
431 std::list<std::pair<int32, int32> > pending_swap_buffers_acks_; 428 std::list<std::pair<int32, int32> > pending_swap_buffers_acks_;
432 429
433 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewMac); 430 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewMac);
434 }; 431 };
435 432
436 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ 433 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/renderer_host/render_widget_host_view_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698