Chromium Code Reviews| 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 stores first rectangle for character range if the | |
| 335 // requested |range| is already cached, otherwise returns false. | |
| 336 bool GetCachedFirstRectForCharacterRange(NSRange range, NSRect* rect, | |
| 337 NSRange* actual_range); | |
| 338 | |
| 339 // Returns true if there is line break in |range| and stores line breaking | |
| 340 // point to |line_breaking_point|. The |line_breaking_point| is valid only if | |
|
Nico
2012/07/21 16:43:27
s/line_breaking_point/line_break_point/
Seigo Nonaka
2012/07/23 08:36:55
Done.
| |
| 341 // this function returns true. | |
| 342 bool GetLineBreakIdx(const std::vector<gfx::Rect>& bounds, | |
|
Nico
2012/07/21 16:43:27
nit: No abbreviations in method names
Seigo Nonaka
2012/07/23 08:36:55
Done.
| |
| 343 const ui::Range& range, | |
| 344 size_t* line_break_point); | |
| 345 | |
| 346 // Returns composition character boundary rectangle. The |range| is | |
| 347 // composition based range. Also stores |actual_range| which is corresponding | |
| 348 // to actually used range for returned rectangle. | |
| 349 gfx::Rect GetFirstRectForCompositionRange(const ui::Range& range, | |
| 350 ui::Range* actual_range); | |
| 351 | |
| 352 // Converts from given whole character range to composition oriented range. If | |
| 353 // the conversion failed, return ui::Range::InvalidRange. | |
| 354 ui::Range ConvertCharacterRangeToCompositionRange( | |
| 355 const ui::Range& request_range); | |
| 356 | |
| 334 // These member variables should be private, but the associated ObjC class | 357 // These member variables should be private, but the associated ObjC class |
| 335 // needs access to them and can't be made a friend. | 358 // needs access to them and can't be made a friend. |
| 336 | 359 |
| 337 // The associated Model. Can be NULL if Destroy() is called when | 360 // The associated Model. Can be NULL if Destroy() is called when |
| 338 // someone (other than superview) has retained |cocoa_view_|. | 361 // someone (other than superview) has retained |cocoa_view_|. |
| 339 content::RenderWidgetHostImpl* render_widget_host_; | 362 content::RenderWidgetHostImpl* render_widget_host_; |
| 340 | 363 |
| 341 // This is true when we are currently painting and thus should handle extra | 364 // 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. | 365 // paint requests by expanding the invalid rect rather than actually painting. |
| 343 bool about_to_validate_and_paint_; | 366 bool about_to_validate_and_paint_; |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 420 std::string selected_text_; | 443 std::string selected_text_; |
| 421 | 444 |
| 422 // The fullscreen window used for pepper flash. | 445 // The fullscreen window used for pepper flash. |
| 423 scoped_nsobject<NSWindow> pepper_fullscreen_window_; | 446 scoped_nsobject<NSWindow> pepper_fullscreen_window_; |
| 424 scoped_nsobject<FullscreenWindowManager> fullscreen_window_manager_; | 447 scoped_nsobject<FullscreenWindowManager> fullscreen_window_manager_; |
| 425 | 448 |
| 426 // List of pending swaps for deferred acking: | 449 // List of pending swaps for deferred acking: |
| 427 // pairs of (route_id, gpu_host_id). | 450 // pairs of (route_id, gpu_host_id). |
| 428 std::list<std::pair<int32, int32> > pending_swap_buffers_acks_; | 451 std::list<std::pair<int32, int32> > pending_swap_buffers_acks_; |
| 429 | 452 |
| 453 // The current composition character range and it's bounds. | |
|
Nico
2012/07/21 16:43:27
s/it's/its/
Seigo Nonaka
2012/07/23 08:36:55
Done.
| |
| 454 ui::Range composition_range_; | |
| 455 std::vector<gfx::Rect> composition_bounds_; | |
| 456 | |
| 457 // The current caret bounds. | |
| 458 gfx::Rect caret_rect_; | |
| 459 | |
| 430 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewMac); | 460 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewMac); |
| 431 }; | 461 }; |
| 432 | 462 |
| 433 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ | 463 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ |
| OLD | NEW |