Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(33)

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_mac.h

Issue 1301173002: Avoid sync IPCs for firstRectForCharacterRange/attributedSubstringForProposedRange. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: avoid leak. Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <IOSurface/IOSurface.h> 9 #include <IOSurface/IOSurface.h>
10 #include <list> 10 #include <list>
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 void ForwardMouseEvent(const blink::WebMouseEvent& event); 354 void ForwardMouseEvent(const blink::WebMouseEvent& event);
355 355
356 void KillSelf(); 356 void KillSelf();
357 357
358 void SetTextInputActive(bool active); 358 void SetTextInputActive(bool active);
359 359
360 // Sends completed plugin IME notification and text back to the renderer. 360 // Sends completed plugin IME notification and text back to the renderer.
361 void PluginImeCompositionCompleted(const base::string16& text, int plugin_id); 361 void PluginImeCompositionCompleted(const base::string16& text, int plugin_id);
362 362
363 const std::string& selected_text() const { return selected_text_; } 363 const std::string& selected_text() const { return selected_text_; }
364 const gfx::Range& composition_range() const { return composition_range_; }
365 const base::string16& selection_text() const { return selection_text_; }
366 size_t selection_text_offset() const { return selection_text_offset_; }
364 367
365 // Returns true and stores first rectangle for character range if the 368 // Returns true and stores first rectangle for character range if the
366 // requested |range| is already cached, otherwise returns false. 369 // requested |range| is already cached, otherwise returns false.
367 // Exposed for testing. 370 // Exposed for testing.
368 CONTENT_EXPORT bool GetCachedFirstRectForCharacterRange( 371 CONTENT_EXPORT bool GetCachedFirstRectForCharacterRange(
369 NSRange range, NSRect* rect, NSRange* actual_range); 372 NSRange range, NSRect* rect, NSRange* actual_range);
370 373
371 // Returns true if there is line break in |range| and stores line breaking 374 // Returns true if there is line break in |range| and stores line breaking
372 // point to |line_breaking_point|. The |line_break_point| is valid only if 375 // point to |line_breaking_point|. The |line_break_point| is valid only if
373 // this function returns true. 376 // this function returns true.
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
578 base::TimeTicks vsync_timebase_; 581 base::TimeTicks vsync_timebase_;
579 base::TimeDelta vsync_interval_; 582 base::TimeDelta vsync_interval_;
580 583
581 // The current composition character range and its bounds. 584 // The current composition character range and its bounds.
582 gfx::Range composition_range_; 585 gfx::Range composition_range_;
583 std::vector<gfx::Rect> composition_bounds_; 586 std::vector<gfx::Rect> composition_bounds_;
584 587
585 // The current caret bounds. 588 // The current caret bounds.
586 gfx::Rect caret_rect_; 589 gfx::Rect caret_rect_;
587 590
591 // The current first selection bounds.
592 gfx::Rect first_selection_rect_;
593
588 // Factory used to safely scope delayed calls to ShutdownHost(). 594 // Factory used to safely scope delayed calls to ShutdownHost().
589 base::WeakPtrFactory<RenderWidgetHostViewMac> weak_factory_; 595 base::WeakPtrFactory<RenderWidgetHostViewMac> weak_factory_;
590 596
591 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewMac); 597 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewMac);
592 }; 598 };
593 599
594 } // namespace content 600 } // namespace content
595 601
596 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ 602 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698