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 | 7 |
8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
9 #include <list> | 9 #include <list> |
10 #include <map> | 10 #include <map> |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 const std::vector<WebPluginGeometry>& moves) OVERRIDE; | 245 const std::vector<WebPluginGeometry>& moves) OVERRIDE; |
246 virtual void Focus() OVERRIDE; | 246 virtual void Focus() OVERRIDE; |
247 virtual void Blur() OVERRIDE; | 247 virtual void Blur() OVERRIDE; |
248 virtual void UpdateCursor(const WebCursor& cursor) OVERRIDE; | 248 virtual void UpdateCursor(const WebCursor& cursor) OVERRIDE; |
249 virtual void SetIsLoading(bool is_loading) OVERRIDE; | 249 virtual void SetIsLoading(bool is_loading) OVERRIDE; |
250 virtual void TextInputTypeChanged(ui::TextInputType type, | 250 virtual void TextInputTypeChanged(ui::TextInputType type, |
251 ui::TextInputMode input_mode, | 251 ui::TextInputMode input_mode, |
252 bool can_compose_inline) OVERRIDE; | 252 bool can_compose_inline) OVERRIDE; |
253 virtual void ImeCancelComposition() OVERRIDE; | 253 virtual void ImeCancelComposition() OVERRIDE; |
254 virtual void ImeCompositionRangeChanged( | 254 virtual void ImeCompositionRangeChanged( |
255 const ui::Range& range, | 255 const gfx::Range& range, |
256 const std::vector<gfx::Rect>& character_bounds) OVERRIDE; | 256 const std::vector<gfx::Rect>& character_bounds) OVERRIDE; |
257 virtual void DidUpdateBackingStore( | 257 virtual void DidUpdateBackingStore( |
258 const gfx::Rect& scroll_rect, | 258 const gfx::Rect& scroll_rect, |
259 const gfx::Vector2d& scroll_delta, | 259 const gfx::Vector2d& scroll_delta, |
260 const std::vector<gfx::Rect>& copy_rects, | 260 const std::vector<gfx::Rect>& copy_rects, |
261 const ui::LatencyInfo& latency_info) OVERRIDE; | 261 const ui::LatencyInfo& latency_info) OVERRIDE; |
262 virtual void RenderProcessGone(base::TerminationStatus status, | 262 virtual void RenderProcessGone(base::TerminationStatus status, |
263 int error_code) OVERRIDE; | 263 int error_code) OVERRIDE; |
264 virtual void Destroy() OVERRIDE; | 264 virtual void Destroy() OVERRIDE; |
265 virtual void SetTooltipText(const string16& tooltip_text) OVERRIDE; | 265 virtual void SetTooltipText(const string16& tooltip_text) OVERRIDE; |
266 virtual void SelectionChanged(const string16& text, | 266 virtual void SelectionChanged(const string16& text, |
267 size_t offset, | 267 size_t offset, |
268 const ui::Range& range) OVERRIDE; | 268 const gfx::Range& range) OVERRIDE; |
269 virtual void SelectionBoundsChanged( | 269 virtual void SelectionBoundsChanged( |
270 const ViewHostMsg_SelectionBounds_Params& params) OVERRIDE; | 270 const ViewHostMsg_SelectionBounds_Params& params) OVERRIDE; |
271 virtual void ScrollOffsetChanged() OVERRIDE; | 271 virtual void ScrollOffsetChanged() OVERRIDE; |
272 virtual BackingStore* AllocBackingStore(const gfx::Size& size) OVERRIDE; | 272 virtual BackingStore* AllocBackingStore(const gfx::Size& size) OVERRIDE; |
273 virtual void CopyFromCompositingSurface( | 273 virtual void CopyFromCompositingSurface( |
274 const gfx::Rect& src_subrect, | 274 const gfx::Rect& src_subrect, |
275 const gfx::Size& dst_size, | 275 const gfx::Size& dst_size, |
276 const base::Callback<void(bool, const SkBitmap&)>& callback) OVERRIDE; | 276 const base::Callback<void(bool, const SkBitmap&)>& callback) OVERRIDE; |
277 virtual void CopyFromCompositingSurfaceToVideoFrame( | 277 virtual void CopyFromCompositingSurfaceToVideoFrame( |
278 const gfx::Rect& src_subrect, | 278 const gfx::Rect& src_subrect, |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
347 // Returns true and stores first rectangle for character range if the | 347 // Returns true and stores first rectangle for character range if the |
348 // requested |range| is already cached, otherwise returns false. | 348 // requested |range| is already cached, otherwise returns false. |
349 // Exposed for testing. | 349 // Exposed for testing. |
350 CONTENT_EXPORT bool GetCachedFirstRectForCharacterRange( | 350 CONTENT_EXPORT bool GetCachedFirstRectForCharacterRange( |
351 NSRange range, NSRect* rect, NSRange* actual_range); | 351 NSRange range, NSRect* rect, NSRange* actual_range); |
352 | 352 |
353 // Returns true if there is line break in |range| and stores line breaking | 353 // Returns true if there is line break in |range| and stores line breaking |
354 // point to |line_breaking_point|. The |line_break_point| is valid only if | 354 // point to |line_breaking_point|. The |line_break_point| is valid only if |
355 // this function returns true. | 355 // this function returns true. |
356 bool GetLineBreakIndex(const std::vector<gfx::Rect>& bounds, | 356 bool GetLineBreakIndex(const std::vector<gfx::Rect>& bounds, |
357 const ui::Range& range, | 357 const gfx::Range& range, |
358 size_t* line_break_point); | 358 size_t* line_break_point); |
359 | 359 |
360 // Returns composition character boundary rectangle. The |range| is | 360 // Returns composition character boundary rectangle. The |range| is |
361 // composition based range. Also stores |actual_range| which is corresponding | 361 // composition based range. Also stores |actual_range| which is corresponding |
362 // to actually used range for returned rectangle. | 362 // to actually used range for returned rectangle. |
363 gfx::Rect GetFirstRectForCompositionRange(const ui::Range& range, | 363 gfx::Rect GetFirstRectForCompositionRange(const gfx::Range& range, |
364 ui::Range* actual_range); | 364 gfx::Range* actual_range); |
365 | 365 |
366 // Converts from given whole character range to composition oriented range. If | 366 // Converts from given whole character range to composition oriented range. If |
367 // the conversion failed, return ui::Range::InvalidRange. | 367 // the conversion failed, return gfx::Range::InvalidRange. |
368 ui::Range ConvertCharacterRangeToCompositionRange( | 368 gfx::Range ConvertCharacterRangeToCompositionRange( |
369 const ui::Range& request_range); | 369 const gfx::Range& request_range); |
370 | 370 |
371 // These member variables should be private, but the associated ObjC class | 371 // These member variables should be private, but the associated ObjC class |
372 // needs access to them and can't be made a friend. | 372 // needs access to them and can't be made a friend. |
373 | 373 |
374 // The associated Model. Can be NULL if Destroy() is called when | 374 // The associated Model. Can be NULL if Destroy() is called when |
375 // someone (other than superview) has retained |cocoa_view_|. | 375 // someone (other than superview) has retained |cocoa_view_|. |
376 RenderWidgetHostImpl* render_widget_host_; | 376 RenderWidgetHostImpl* render_widget_host_; |
377 | 377 |
378 // This is true when we are currently painting and thus should handle extra | 378 // This is true when we are currently painting and thus should handle extra |
379 // paint requests by expanding the invalid rect rather than actually painting. | 379 // paint requests by expanding the invalid rect rather than actually painting. |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
541 // Factory used to cancel outstanding throttled AckPendingSwapBuffers calls. | 541 // Factory used to cancel outstanding throttled AckPendingSwapBuffers calls. |
542 base::WeakPtrFactory<RenderWidgetHostViewMac> | 542 base::WeakPtrFactory<RenderWidgetHostViewMac> |
543 pending_swap_buffers_acks_weak_factory_; | 543 pending_swap_buffers_acks_weak_factory_; |
544 | 544 |
545 // The earliest time at which the next swap ack may be sent. Only relevant | 545 // The earliest time at which the next swap ack may be sent. Only relevant |
546 // when swaps are not being throttled by the renderer (when threaded | 546 // when swaps are not being throttled by the renderer (when threaded |
547 // compositing is off). | 547 // compositing is off). |
548 base::Time next_swap_ack_time_; | 548 base::Time next_swap_ack_time_; |
549 | 549 |
550 // The current composition character range and its bounds. | 550 // The current composition character range and its bounds. |
551 ui::Range composition_range_; | 551 gfx::Range composition_range_; |
552 std::vector<gfx::Rect> composition_bounds_; | 552 std::vector<gfx::Rect> composition_bounds_; |
553 | 553 |
554 // The current caret bounds. | 554 // The current caret bounds. |
555 gfx::Rect caret_rect_; | 555 gfx::Rect caret_rect_; |
556 | 556 |
557 // Subscriber that listens to frame presentation events. | 557 // Subscriber that listens to frame presentation events. |
558 scoped_ptr<RenderWidgetHostViewFrameSubscriber> frame_subscriber_; | 558 scoped_ptr<RenderWidgetHostViewFrameSubscriber> frame_subscriber_; |
559 | 559 |
560 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewMac); | 560 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewMac); |
561 }; | 561 }; |
562 | 562 |
563 } // namespace content | 563 } // namespace content |
564 | 564 |
565 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ | 565 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ |
OLD | NEW |