Clean up check for dependency_info.
[chromium-blink-merge.git] / content / browser / renderer_host / render_widget_host_view_mac.h
blobee840c41034a3234c8ece5e5a68d2eeba26b093f
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
3 // found in the LICENSE file.
5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_
8 #import <Cocoa/Cocoa.h>
9 #include <IOSurface/IOSurface.h>
10 #include <list>
11 #include <map>
12 #include <set>
13 #include <string>
14 #include <utility>
15 #include <vector>
17 #include "base/mac/scoped_nsobject.h"
18 #include "base/memory/scoped_ptr.h"
19 #include "base/memory/weak_ptr.h"
20 #include "base/time/time.h"
21 #include "content/browser/compositor/browser_compositor_view_mac.h"
22 #include "content/browser/compositor/delegated_frame_host.h"
23 #include "content/browser/renderer_host/input/mouse_wheel_rails_filter_mac.h"
24 #include "content/browser/renderer_host/render_widget_host_view_base.h"
25 #include "content/common/content_export.h"
26 #include "content/common/cursors/webcursor.h"
27 #include "content/common/edit_command.h"
28 #include "ipc/ipc_sender.h"
29 #include "third_party/WebKit/public/web/WebCompositionUnderline.h"
30 #include "ui/accelerated_widget_mac/accelerated_widget_mac.h"
31 #include "ui/accelerated_widget_mac/display_link_mac.h"
32 #include "ui/accelerated_widget_mac/io_surface_layer.h"
33 #import "ui/base/cocoa/command_dispatcher.h"
34 #include "ui/base/cocoa/remote_layer_api.h"
35 #import "ui/base/cocoa/tool_tip_base_view.h"
36 #include "ui/gfx/display_observer.h"
38 struct ViewHostMsg_TextInputState_Params;
40 namespace content {
41 class RenderWidgetHostImpl;
42 class RenderWidgetHostViewMac;
43 class RenderWidgetHostViewMacEditCommandHelper;
44 class WebContents;
47 namespace ui {
48 class Compositor;
49 class Layer;
52 @class FullscreenWindowManager;
53 @protocol RenderWidgetHostViewMacDelegate;
55 @protocol RenderWidgetHostViewMacOwner
56 - (content::RenderWidgetHostViewMac*)renderWidgetHostViewMac;
57 @end
59 // This is the view that lives in the Cocoa view hierarchy. In Windows-land,
60 // RenderWidgetHostViewWin is both the view and the delegate. We split the roles
61 // but that means that the view needs to own the delegate and will dispose of it
62 // when it's removed from the view system.
63 @interface RenderWidgetHostViewCocoa
64 : ToolTipBaseView<CommandDispatcherTarget,
65 RenderWidgetHostViewMacOwner,
66 NSTextInputClient> {
67 @private
68 scoped_ptr<content::RenderWidgetHostViewMac> renderWidgetHostView_;
69 // This ivar is the cocoa delegate of the NSResponder.
70 base::scoped_nsobject<NSObject<RenderWidgetHostViewMacDelegate>>
71 responderDelegate_;
72 BOOL canBeKeyView_;
73 BOOL closeOnDeactivate_;
74 BOOL opaque_;
75 scoped_ptr<content::RenderWidgetHostViewMacEditCommandHelper>
76 editCommand_helper_;
78 // Is YES if there was a mouse-down as yet unbalanced with a mouse-up.
79 BOOL hasOpenMouseDown_;
81 NSWindow* lastWindow_; // weak
83 // The cursor for the page. This is passed up from the renderer.
84 base::scoped_nsobject<NSCursor> currentCursor_;
86 // Variables used by our implementaion of the NSTextInput protocol.
87 // An input method of Mac calls the methods of this protocol not only to
88 // notify an application of its status, but also to retrieve the status of
89 // the application. That is, an application cannot control an input method
90 // directly.
91 // This object keeps the status of a composition of the renderer and returns
92 // it when an input method asks for it.
93 // We need to implement Objective-C methods for the NSTextInput protocol. On
94 // the other hand, we need to implement a C++ method for an IPC-message
95 // handler which receives input-method events from the renderer.
97 // Represents the input-method attributes supported by this object.
98 base::scoped_nsobject<NSArray> validAttributesForMarkedText_;
100 // Indicates if we are currently handling a key down event.
101 BOOL handlingKeyDown_;
103 // Indicates if there is any marked text.
104 BOOL hasMarkedText_;
106 // Indicates if unmarkText is called or not when handling a keyboard
107 // event.
108 BOOL unmarkTextCalled_;
110 // The range of current marked text inside the whole content of the DOM node
111 // being edited.
112 // TODO(suzhe): This is currently a fake value, as we do not support accessing
113 // the whole content yet.
114 NSRange markedRange_;
116 // The selected range, cached from a message sent by the renderer.
117 NSRange selectedRange_;
119 // Text to be inserted which was generated by handling a key down event.
120 base::string16 textToBeInserted_;
122 // Marked text which was generated by handling a key down event.
123 base::string16 markedText_;
125 // Selected range of |markedText_|.
126 NSRange markedTextSelectedRange_;
128 // Underline information of the |markedText_|.
129 std::vector<blink::WebCompositionUnderline> underlines_;
131 // Indicates if doCommandBySelector method receives any edit command when
132 // handling a key down event.
133 BOOL hasEditCommands_;
135 // Contains edit commands received by the -doCommandBySelector: method when
136 // handling a key down event, not including inserting commands, eg. insertTab,
137 // etc.
138 content::EditCommands editCommands_;
140 // The plugin that currently has focus (-1 if no plugin has focus).
141 int focusedPluginIdentifier_;
143 // Whether or not plugin IME is currently enabled active.
144 BOOL pluginImeActive_;
146 // Whether the previous mouse event was ignored due to hitTest check.
147 BOOL mouseEventWasIgnored_;
149 // Event monitor for scroll wheel end event.
150 id endWheelMonitor_;
152 // When a gesture starts, the system does not inform the view of which type
153 // of gesture is happening (magnify, rotate, etc), rather, it just informs
154 // the view that some as-yet-undefined gesture is starting. Capture the
155 // information about the gesture's beginning event here. It will be used to
156 // create a specific gesture begin event later.
157 scoped_ptr<blink::WebGestureEvent> gestureBeginEvent_;
159 // To avoid accidental pinches, require that a certain zoom threshold be
160 // reached before forwarding it to the browser. Use |pinchUnusedAmount_| to
161 // hold this value. If the user reaches this value, don't re-require the
162 // threshold be reached until the page has been zoomed back to page scale of
163 // one.
164 bool pinchHasReachedZoomThreshold_;
165 float pinchUnusedAmount_;
166 NSTimeInterval pinchLastGestureTimestamp_;
168 // This is set if a GesturePinchBegin event has been sent in the lifetime of
169 // |gestureBeginEvent_|. If set, a GesturePinchEnd will be sent when the
170 // gesture ends.
171 BOOL gestureBeginPinchSent_;
173 // If true then escape key down events are suppressed until the first escape
174 // key up event. (The up event is suppressed as well). This is used by the
175 // flash fullscreen code to avoid sending a key up event without a matching
176 // key down event.
177 BOOL suppressNextEscapeKeyUp_;
179 // The set of key codes from key down events that we haven't seen the matching
180 // key up events yet.
181 // Used for filtering out non-matching NSKeyUp events.
182 std::set<unsigned short> keyDownCodes_;
184 // The filter used to guide touch events towards a horizontal or vertical
185 // orientation.
186 content::MouseWheelRailsFilterMac mouseWheelFilter_;
189 @property(nonatomic, readonly) NSRange selectedRange;
190 @property(nonatomic, readonly) BOOL suppressNextEscapeKeyUp;
192 - (void)setCanBeKeyView:(BOOL)can;
193 - (void)setCloseOnDeactivate:(BOOL)b;
194 - (void)setOpaque:(BOOL)opaque;
195 // True for always-on-top special windows (e.g. Balloons and Panels).
196 - (BOOL)acceptsMouseEventsWhenInactive;
197 // Cancel ongoing composition (abandon the marked text).
198 - (void)cancelComposition;
199 // Confirm ongoing composition.
200 - (void)confirmComposition;
201 // Enables or disables plugin IME.
202 - (void)setPluginImeActive:(BOOL)active;
203 // Updates the current plugin focus state.
204 - (void)pluginFocusChanged:(BOOL)focused forPlugin:(int)pluginId;
205 // Evaluates the event in the context of plugin IME, if plugin IME is enabled.
206 // Returns YES if the event was handled.
207 - (BOOL)postProcessEventForPluginIme:(NSEvent*)event;
208 - (void)updateCursor:(NSCursor*)cursor;
209 - (NSRect)firstViewRectForCharacterRange:(NSRange)theRange
210 actualRange:(NSRangePointer)actualRange;
211 @end
213 namespace content {
215 ///////////////////////////////////////////////////////////////////////////////
216 // RenderWidgetHostViewMac
218 // An object representing the "View" of a rendered web page. This object is
219 // responsible for displaying the content of the web page, and integrating with
220 // the Cocoa view system. It is the implementation of the RenderWidgetHostView
221 // that the cross-platform RenderWidgetHost object uses
222 // to display the data.
224 // Comment excerpted from render_widget_host.h:
226 // "The lifetime of the RenderWidgetHost* is tied to the render process.
227 // If the render process dies, the RenderWidgetHost* goes away and all
228 // references to it must become NULL."
230 // RenderWidgetHostView class hierarchy described in render_widget_host_view.h.
231 class CONTENT_EXPORT RenderWidgetHostViewMac
232 : public RenderWidgetHostViewBase,
233 public DelegatedFrameHostClient,
234 public ui::AcceleratedWidgetMacNSView,
235 public IPC::Sender,
236 public gfx::DisplayObserver {
237 public:
238 // The view will associate itself with the given widget. The native view must
239 // be hooked up immediately to the view hierarchy, or else when it is
240 // deleted it will delete this out from under the caller.
242 // When |is_guest_view_hack| is true, this view isn't really the view for
243 // the |widget|, a RenderWidgetHostViewGuest is.
244 // TODO(lazyboy): Remove |is_guest_view_hack| once BrowserPlugin has migrated
245 // to use RWHVChildFrame (http://crbug.com/330264).
246 RenderWidgetHostViewMac(RenderWidgetHost* widget, bool is_guest_view_hack);
247 ~RenderWidgetHostViewMac() override;
249 RenderWidgetHostViewCocoa* cocoa_view() const { return cocoa_view_; }
251 // |delegate| is used to separate out the logic from the NSResponder delegate.
252 // |delegate| is retained by this class.
253 // |delegate| should be set at most once.
254 CONTENT_EXPORT void SetDelegate(
255 NSObject<RenderWidgetHostViewMacDelegate>* delegate);
256 void SetAllowPauseForResizeOrRepaint(bool allow);
258 // RenderWidgetHostView implementation.
259 bool OnMessageReceived(const IPC::Message& msg) override;
260 void InitAsChild(gfx::NativeView parent_view) override;
261 RenderWidgetHost* GetRenderWidgetHost() const override;
262 void SetSize(const gfx::Size& size) override;
263 void SetBounds(const gfx::Rect& rect) override;
264 gfx::Vector2dF GetLastScrollOffset() const override;
265 gfx::NativeView GetNativeView() const override;
266 gfx::NativeViewId GetNativeViewId() const override;
267 gfx::NativeViewAccessible GetNativeViewAccessible() override;
268 bool HasFocus() const override;
269 bool IsSurfaceAvailableForCopy() const override;
270 void Show() override;
271 void Hide() override;
272 bool IsShowing() override;
273 void WasUnOccluded() override;
274 void WasOccluded() override;
275 gfx::Rect GetViewBounds() const override;
276 void SetShowingContextMenu(bool showing) override;
277 void SetActive(bool active) override;
278 void SetWindowVisibility(bool visible) override;
279 void WindowFrameChanged() override;
280 void ShowDefinitionForSelection() override;
281 bool SupportsSpeech() const override;
282 void SpeakSelection() override;
283 bool IsSpeaking() const override;
284 void StopSpeaking() override;
285 void SetBackgroundColor(SkColor color) override;
287 // Implementation of RenderWidgetHostViewBase.
288 void InitAsPopup(RenderWidgetHostView* parent_host_view,
289 const gfx::Rect& pos) override;
290 void InitAsFullscreen(RenderWidgetHostView* reference_host_view) override;
291 void MovePluginWindows(const std::vector<WebPluginGeometry>& moves) override;
292 void Focus() override;
293 void UpdateCursor(const WebCursor& cursor) override;
294 void SetIsLoading(bool is_loading) override;
295 void TextInputStateChanged(
296 const ViewHostMsg_TextInputState_Params& params) override;
297 void ImeCancelComposition() override;
298 void ImeCompositionRangeChanged(
299 const gfx::Range& range,
300 const std::vector<gfx::Rect>& character_bounds) override;
301 void RenderProcessGone(base::TerminationStatus status,
302 int error_code) override;
303 void RenderWidgetHostGone() override;
304 void Destroy() override;
305 void SetTooltipText(const base::string16& tooltip_text) override;
306 void SelectionChanged(const base::string16& text,
307 size_t offset,
308 const gfx::Range& range) override;
309 void SelectionBoundsChanged(
310 const ViewHostMsg_SelectionBounds_Params& params) override;
311 void CopyFromCompositingSurface(const gfx::Rect& src_subrect,
312 const gfx::Size& dst_size,
313 ReadbackRequestCallback& callback,
314 SkColorType preferred_color_type) override;
315 void CopyFromCompositingSurfaceToVideoFrame(
316 const gfx::Rect& src_subrect,
317 const scoped_refptr<media::VideoFrame>& target,
318 const base::Callback<void(bool)>& callback) override;
319 bool CanCopyToVideoFrame() const override;
320 bool CanSubscribeFrame() const override;
321 void BeginFrameSubscription(
322 scoped_ptr<RenderWidgetHostViewFrameSubscriber> subscriber) override;
323 void EndFrameSubscription() override;
324 void OnSwapCompositorFrame(uint32 output_surface_id,
325 scoped_ptr<cc::CompositorFrame> frame) override;
326 void ClearCompositorFrame() override;
327 BrowserAccessibilityManager* CreateBrowserAccessibilityManager(
328 BrowserAccessibilityDelegate* delegate) override;
329 gfx::Point AccessibilityOriginInScreen(const gfx::Rect& bounds) override;
330 bool PostProcessEventForPluginIme(
331 const NativeWebKeyboardEvent& event) override;
333 bool HasAcceleratedSurface(const gfx::Size& desired_size) override;
334 void GetScreenInfo(blink::WebScreenInfo* results) override;
335 bool GetScreenColorProfile(std::vector<char>* color_profile) override;
336 gfx::Rect GetBoundsInRootWindow() override;
337 gfx::GLSurfaceHandle GetCompositingSurface() override;
339 bool LockMouse() override;
340 void UnlockMouse() override;
341 void WheelEventAck(const blink::WebMouseWheelEvent& event,
342 InputEventAckState ack_result) override;
344 uint32_t GetSurfaceIdNamespace() override;
345 uint32_t SurfaceIdNamespaceAtPoint(const gfx::Point& point,
346 gfx::Point* transformed_point) override;
347 void ProcessMouseEvent(const blink::WebMouseEvent& event) override;
348 void ProcessMouseWheelEvent(const blink::WebMouseWheelEvent& event) override;
350 // IPC::Sender implementation.
351 bool Send(IPC::Message* message) override;
353 // gfx::DisplayObserver implementation.
354 void OnDisplayAdded(const gfx::Display& new_display) override;
355 void OnDisplayRemoved(const gfx::Display& old_display) override;
356 void OnDisplayMetricsChanged(const gfx::Display& display,
357 uint32_t metrics) override;
359 // Forwards the mouse event to the renderer.
360 void ForwardMouseEvent(const blink::WebMouseEvent& event);
362 void KillSelf();
364 void SetTextInputActive(bool active);
366 // Sends completed plugin IME notification and text back to the renderer.
367 void PluginImeCompositionCompleted(const base::string16& text, int plugin_id);
369 const std::string& selected_text() const { return selected_text_; }
371 // Returns true and stores first rectangle for character range if the
372 // requested |range| is already cached, otherwise returns false.
373 // Exposed for testing.
374 CONTENT_EXPORT bool GetCachedFirstRectForCharacterRange(
375 NSRange range, NSRect* rect, NSRange* actual_range);
377 // Returns true if there is line break in |range| and stores line breaking
378 // point to |line_breaking_point|. The |line_break_point| is valid only if
379 // this function returns true.
380 bool GetLineBreakIndex(const std::vector<gfx::Rect>& bounds,
381 const gfx::Range& range,
382 size_t* line_break_point);
384 // Returns composition character boundary rectangle. The |range| is
385 // composition based range. Also stores |actual_range| which is corresponding
386 // to actually used range for returned rectangle.
387 gfx::Rect GetFirstRectForCompositionRange(const gfx::Range& range,
388 gfx::Range* actual_range);
390 // Converts from given whole character range to composition oriented range. If
391 // the conversion failed, return gfx::Range::InvalidRange.
392 gfx::Range ConvertCharacterRangeToCompositionRange(
393 const gfx::Range& request_range);
395 WebContents* GetWebContents();
397 // These member variables should be private, but the associated ObjC class
398 // needs access to them and can't be made a friend.
400 // The associated Model. Can be NULL if Destroy() is called when
401 // someone (other than superview) has retained |cocoa_view_|.
402 RenderWidgetHostImpl* render_widget_host_;
404 // Current text input type.
405 ui::TextInputType text_input_type_;
406 bool can_compose_inline_;
408 // The background CoreAnimation layer which is hosted by |cocoa_view_|.
409 base::scoped_nsobject<CALayer> background_layer_;
411 // The state of |delegated_frame_host_| and |browser_compositor_| to
412 // manage being visible, hidden, or occluded.
413 enum BrowserCompositorViewState {
414 // Effects:
415 // - |browser_compositor_| exists and |delegated_frame_host_| is
416 // visible.
417 // Happens when:
418 // - |render_widet_host_| is in the visible state (this includes when
419 // the tab isn't visible, but tab capture is enabled).
420 BrowserCompositorActive,
421 // Effects:
422 // - |browser_compositor_| exists, but |delegated_frame_host_| has
423 // been hidden.
424 // Happens when:
425 // - The |render_widget_host_| is hidden, but |cocoa_view_| is still in the
426 // NSWindow hierarchy.
427 // - This happens when |cocoa_view_| is hidden (minimized, on another
428 // occluded by other windows, etc). The |browser_compositor_| and
429 // its CALayers are kept around so that we will have content to show when
430 // we are un-occluded.
431 BrowserCompositorSuspended,
432 // Effects:
433 // - |browser_compositor_| has been destroyed and
434 // |delegated_frame_host_| has been hidden.
435 // Happens when:
436 // - The |render_widget_host_| is hidden or dead, and |cocoa_view_| is not
437 // attached to a NSWindow.
438 // - This happens for backgrounded tabs.
439 BrowserCompositorDestroyed,
441 BrowserCompositorViewState browser_compositor_state_;
443 // Delegated frame management and compositor.
444 scoped_ptr<DelegatedFrameHost> delegated_frame_host_;
445 scoped_ptr<ui::Layer> root_layer_;
447 // Container for ui::Compositor the CALayer tree drawn by it.
448 scoped_ptr<BrowserCompositorMac> browser_compositor_;
450 // Placeholder that is allocated while browser_compositor_ is NULL,
451 // indicating that a BrowserCompositorViewMac may be allocated. This is to
452 // help in recycling the internals of BrowserCompositorViewMac.
453 scoped_ptr<BrowserCompositorMacPlaceholder>
454 browser_compositor_placeholder_;
456 // Set when the currently-displayed frame is the minimum scale. Used to
457 // determine if pinch gestures need to be thresholded.
458 bool page_at_minimum_scale_;
460 NSWindow* pepper_fullscreen_window() const {
461 return pepper_fullscreen_window_;
464 CONTENT_EXPORT void release_pepper_fullscreen_window_for_testing();
466 RenderWidgetHostViewMac* fullscreen_parent_host_view() const {
467 return fullscreen_parent_host_view_;
470 int window_number() const;
472 // The scale factor for the screen that the view is currently on.
473 float ViewScaleFactor() const;
475 // Update properties, such as the scale factor for the backing store
476 // and for any CALayers, and the screen color profile.
477 void UpdateBackingStoreProperties();
479 // Ensure that the display link is associated with the correct display.
480 void UpdateDisplayLink();
482 void PauseForPendingResizeOrRepaintsAndDraw();
484 // DelegatedFrameHostClient implementation.
485 ui::Layer* DelegatedFrameHostGetLayer() const override;
486 bool DelegatedFrameHostIsVisible() const override;
487 gfx::Size DelegatedFrameHostDesiredSizeInDIP() const override;
488 bool DelegatedFrameCanCreateResizeLock() const override;
489 scoped_ptr<ResizeLock> DelegatedFrameHostCreateResizeLock(
490 bool defer_compositor_lock) override;
491 void DelegatedFrameHostResizeLockWasReleased() override;
492 void DelegatedFrameHostSendCompositorSwapAck(
493 int output_surface_id,
494 const cc::CompositorFrameAck& ack) override;
495 void DelegatedFrameHostSendReclaimCompositorResources(
496 int output_surface_id,
497 const cc::CompositorFrameAck& ack) override;
498 void DelegatedFrameHostOnLostCompositorResources() override;
499 void DelegatedFrameHostUpdateVSyncParameters(
500 const base::TimeTicks& timebase,
501 const base::TimeDelta& interval) override;
503 // AcceleratedWidgetMacNSView implementation.
504 NSView* AcceleratedWidgetGetNSView() const override;
505 bool AcceleratedWidgetShouldIgnoreBackpressure() const override;
506 void AcceleratedWidgetGetVSyncParameters(
507 base::TimeTicks* timebase, base::TimeDelta* interval) const override;
508 void AcceleratedWidgetSwapCompleted(
509 const std::vector<ui::LatencyInfo>& latency_info) override;
510 void AcceleratedWidgetHitError() override;
512 // Transition from being in the Suspended state to being in the Destroyed
513 // state, if appropriate (see BrowserCompositorViewState for details).
514 void DestroySuspendedBrowserCompositorViewIfNeeded();
516 private:
517 friend class RenderWidgetHostViewMacTest;
519 // Returns whether this render view is a popup (autocomplete window).
520 bool IsPopup() const;
522 // Shuts down the render_widget_host_. This is a separate function so we can
523 // invoke it from the message loop.
524 void ShutdownHost();
526 // Tear down all components of the browser compositor in an order that will
527 // ensure no dangling references.
528 void ShutdownBrowserCompositor();
530 // The state of the the browser compositor and delegated frame host. See
531 // BrowserCompositorViewState for details.
532 void EnsureBrowserCompositorView();
533 void SuspendBrowserCompositorView();
534 void DestroyBrowserCompositorView();
536 // IPC message handlers.
537 void OnPluginFocusChanged(bool focused, int plugin_id);
538 void OnStartPluginIme();
539 void OnGetRenderedTextCompleted(const std::string& text);
541 // Send updated vsync parameters to the renderer.
542 void SendVSyncParametersToRenderer();
544 // Dispatches a TTS session.
545 void SpeakText(const std::string& text);
547 // The associated view. This is weak and is inserted into the view hierarchy
548 // to own this RenderWidgetHostViewMac object. Set to nil at the start of the
549 // destructor.
550 RenderWidgetHostViewCocoa* cocoa_view_;
552 // Indicates if the page is loading.
553 bool is_loading_;
555 // Whether it's allowed to pause waiting for a new frame.
556 bool allow_pause_for_resize_or_repaint_;
558 // The last scroll offset of the view.
559 gfx::Vector2dF last_scroll_offset_;
561 // The text to be shown in the tooltip, supplied by the renderer.
562 base::string16 tooltip_text_;
564 // True when this view acts as a platform view hack for a
565 // RenderWidgetHostViewGuest.
566 bool is_guest_view_hack_;
568 // selected text on the renderer.
569 std::string selected_text_;
571 // The window used for popup widgets.
572 base::scoped_nsobject<NSWindow> popup_window_;
574 // The fullscreen window used for pepper flash.
575 base::scoped_nsobject<NSWindow> pepper_fullscreen_window_;
576 base::scoped_nsobject<FullscreenWindowManager> fullscreen_window_manager_;
577 // Our parent host view, if this is fullscreen. NULL otherwise.
578 RenderWidgetHostViewMac* fullscreen_parent_host_view_;
580 // Display link for getting vsync info.
581 scoped_refptr<ui::DisplayLinkMac> display_link_;
583 // The current VSync timebase and interval. This is zero until the first call
584 // to SendVSyncParametersToRenderer(), and refreshed regularly thereafter.
585 base::TimeTicks vsync_timebase_;
586 base::TimeDelta vsync_interval_;
588 // The current composition character range and its bounds.
589 gfx::Range composition_range_;
590 std::vector<gfx::Rect> composition_bounds_;
592 // The current caret bounds.
593 gfx::Rect caret_rect_;
595 // Factory used to safely scope delayed calls to ShutdownHost().
596 base::WeakPtrFactory<RenderWidgetHostViewMac> weak_factory_;
598 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewMac);
601 } // namespace content
603 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_