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