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 | 10 |
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
326 const std::string& selected_text() const { return selected_text_; } | 326 const std::string& selected_text() const { return selected_text_; } |
327 | 327 |
328 // Call setNeedsDisplay on the cocoa_view_. The IOSurface will be drawn during | 328 // Call setNeedsDisplay on the cocoa_view_. The IOSurface will be drawn during |
329 // the next drawRect. Return true if the Ack should be sent, false if it | 329 // the next drawRect. Return true if the Ack should be sent, false if it |
330 // should be deferred until drawRect. | 330 // should be deferred until drawRect. |
331 bool CompositorSwapBuffers(uint64 surface_handle); | 331 bool CompositorSwapBuffers(uint64 surface_handle); |
332 // Ack pending SwapBuffers requests, if any, to unblock the GPU process. Has | 332 // Ack pending SwapBuffers requests, if any, to unblock the GPU process. Has |
333 // no effect if there are no pending requests. | 333 // no effect if there are no pending requests. |
334 void AckPendingSwapBuffers(); | 334 void AckPendingSwapBuffers(); |
335 | 335 |
| 336 // Returns true and stores first rectangle for character range if the |
| 337 // requested |range| is already cached, otherwise returns false. |
| 338 bool GetCachedFirstRectForCharacterRange(NSRange range, NSRect* rect, |
| 339 NSRange* actual_range); |
| 340 |
| 341 // Returns true if there is line break in |range| and stores line breaking |
| 342 // point to |line_breaking_point|. The |line_break_point| is valid only if |
| 343 // this function returns true. |
| 344 bool GetLineBreakIndex(const std::vector<gfx::Rect>& bounds, |
| 345 const ui::Range& range, |
| 346 size_t* line_break_point); |
| 347 |
| 348 // Returns composition character boundary rectangle. The |range| is |
| 349 // composition based range. Also stores |actual_range| which is corresponding |
| 350 // to actually used range for returned rectangle. |
| 351 gfx::Rect GetFirstRectForCompositionRange(const ui::Range& range, |
| 352 ui::Range* actual_range); |
| 353 |
| 354 // Converts from given whole character range to composition oriented range. If |
| 355 // the conversion failed, return ui::Range::InvalidRange. |
| 356 ui::Range ConvertCharacterRangeToCompositionRange( |
| 357 const ui::Range& request_range); |
| 358 |
336 // These member variables should be private, but the associated ObjC class | 359 // These member variables should be private, but the associated ObjC class |
337 // needs access to them and can't be made a friend. | 360 // needs access to them and can't be made a friend. |
338 | 361 |
339 // The associated Model. Can be NULL if Destroy() is called when | 362 // The associated Model. Can be NULL if Destroy() is called when |
340 // someone (other than superview) has retained |cocoa_view_|. | 363 // someone (other than superview) has retained |cocoa_view_|. |
341 RenderWidgetHostImpl* render_widget_host_; | 364 RenderWidgetHostImpl* render_widget_host_; |
342 | 365 |
343 // This is true when we are currently painting and thus should handle extra | 366 // This is true when we are currently painting and thus should handle extra |
344 // paint requests by expanding the invalid rect rather than actually painting. | 367 // paint requests by expanding the invalid rect rather than actually painting. |
345 bool about_to_validate_and_paint_; | 368 bool about_to_validate_and_paint_; |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
422 std::string selected_text_; | 445 std::string selected_text_; |
423 | 446 |
424 // The fullscreen window used for pepper flash. | 447 // The fullscreen window used for pepper flash. |
425 scoped_nsobject<NSWindow> pepper_fullscreen_window_; | 448 scoped_nsobject<NSWindow> pepper_fullscreen_window_; |
426 scoped_nsobject<FullscreenWindowManager> fullscreen_window_manager_; | 449 scoped_nsobject<FullscreenWindowManager> fullscreen_window_manager_; |
427 | 450 |
428 // List of pending swaps for deferred acking: | 451 // List of pending swaps for deferred acking: |
429 // pairs of (route_id, gpu_host_id). | 452 // pairs of (route_id, gpu_host_id). |
430 std::list<std::pair<int32, int32> > pending_swap_buffers_acks_; | 453 std::list<std::pair<int32, int32> > pending_swap_buffers_acks_; |
431 | 454 |
| 455 // The current composition character range and its bounds. |
| 456 ui::Range composition_range_; |
| 457 std::vector<gfx::Rect> composition_bounds_; |
| 458 |
| 459 // The current caret bounds. |
| 460 gfx::Rect caret_rect_; |
| 461 |
432 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewMac); | 462 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewMac); |
433 }; | 463 }; |
434 | 464 |
435 } // namespace content | 465 } // namespace content |
436 | 466 |
437 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ | 467 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ |
OLD | NEW |