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 | 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 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 201 // Enables or disables plugin IME. | 201 // Enables or disables plugin IME. |
| 202 - (void)setPluginImeActive:(BOOL)active; | 202 - (void)setPluginImeActive:(BOOL)active; |
| 203 // Updates the current plugin focus state. | 203 // Updates the current plugin focus state. |
| 204 - (void)pluginFocusChanged:(BOOL)focused forPlugin:(int)pluginId; | 204 - (void)pluginFocusChanged:(BOOL)focused forPlugin:(int)pluginId; |
| 205 // Evaluates the event in the context of plugin IME, if plugin IME is enabled. | 205 // Evaluates the event in the context of plugin IME, if plugin IME is enabled. |
| 206 // Returns YES if the event was handled. | 206 // Returns YES if the event was handled. |
| 207 - (BOOL)postProcessEventForPluginIme:(NSEvent*)event; | 207 - (BOOL)postProcessEventForPluginIme:(NSEvent*)event; |
| 208 - (void)updateCursor:(NSCursor*)cursor; | 208 - (void)updateCursor:(NSCursor*)cursor; |
| 209 - (NSRect)firstViewRectForCharacterRange:(NSRange)theRange | 209 - (NSRect)firstViewRectForCharacterRange:(NSRange)theRange |
| 210 actualRange:(NSRangePointer)actualRange; | 210 actualRange:(NSRangePointer)actualRange; |
| 211 - (void) ShowLookUpDictionary:(NSPoint)point; | |
|
Alexei Svitkine (slow)
2015/09/01 16:27:03
Nit: Use objc naming convention please.
e.g.
- (
Shu Chen
2015/09/02 03:35:42
Done.
| |
| 211 @end | 212 @end |
| 212 | 213 |
| 213 namespace content { | 214 namespace content { |
| 214 | 215 |
| 215 /////////////////////////////////////////////////////////////////////////////// | 216 /////////////////////////////////////////////////////////////////////////////// |
| 216 // RenderWidgetHostViewMac | 217 // RenderWidgetHostViewMac |
| 217 // | 218 // |
| 218 // An object representing the "View" of a rendered web page. This object is | 219 // An object representing the "View" of a rendered web page. This object is |
| 219 // responsible for displaying the content of the web page, and integrating with | 220 // responsible for displaying the content of the web page, and integrating with |
| 220 // the Cocoa view system. It is the implementation of the RenderWidgetHostView | 221 // the Cocoa view system. It is the implementation of the RenderWidgetHostView |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 355 void ForwardMouseEvent(const blink::WebMouseEvent& event); | 356 void ForwardMouseEvent(const blink::WebMouseEvent& event); |
| 356 | 357 |
| 357 void KillSelf(); | 358 void KillSelf(); |
| 358 | 359 |
| 359 void SetTextInputActive(bool active); | 360 void SetTextInputActive(bool active); |
| 360 | 361 |
| 361 // Sends completed plugin IME notification and text back to the renderer. | 362 // Sends completed plugin IME notification and text back to the renderer. |
| 362 void PluginImeCompositionCompleted(const base::string16& text, int plugin_id); | 363 void PluginImeCompositionCompleted(const base::string16& text, int plugin_id); |
| 363 | 364 |
| 364 const std::string& selected_text() const { return selected_text_; } | 365 const std::string& selected_text() const { return selected_text_; } |
| 366 const gfx::Range& composition_range() const { return composition_range_; } | |
| 367 const base::string16& selection_text() const { return selection_text_; } | |
| 368 size_t selection_text_offset() const { return selection_text_offset_; } | |
| 365 | 369 |
| 366 // Returns true and stores first rectangle for character range if the | 370 // Returns true and stores first rectangle for character range if the |
| 367 // requested |range| is already cached, otherwise returns false. | 371 // requested |range| is already cached, otherwise returns false. |
| 368 // Exposed for testing. | 372 // Exposed for testing. |
| 369 CONTENT_EXPORT bool GetCachedFirstRectForCharacterRange( | 373 CONTENT_EXPORT bool GetCachedFirstRectForCharacterRange( |
| 370 NSRange range, NSRect* rect, NSRange* actual_range); | 374 NSRange range, NSRect* rect, NSRange* actual_range); |
| 371 | 375 |
| 372 // Returns true if there is line break in |range| and stores line breaking | 376 // Returns true if there is line break in |range| and stores line breaking |
| 373 // point to |line_breaking_point|. The |line_break_point| is valid only if | 377 // point to |line_breaking_point|. The |line_break_point| is valid only if |
| 374 // this function returns true. | 378 // this function returns true. |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 580 base::TimeTicks vsync_timebase_; | 584 base::TimeTicks vsync_timebase_; |
| 581 base::TimeDelta vsync_interval_; | 585 base::TimeDelta vsync_interval_; |
| 582 | 586 |
| 583 // The current composition character range and its bounds. | 587 // The current composition character range and its bounds. |
| 584 gfx::Range composition_range_; | 588 gfx::Range composition_range_; |
| 585 std::vector<gfx::Rect> composition_bounds_; | 589 std::vector<gfx::Rect> composition_bounds_; |
| 586 | 590 |
| 587 // The current caret bounds. | 591 // The current caret bounds. |
| 588 gfx::Rect caret_rect_; | 592 gfx::Rect caret_rect_; |
| 589 | 593 |
| 594 // The current first selection bounds. | |
| 595 gfx::Rect first_selection_rect_; | |
| 596 | |
| 590 // Factory used to safely scope delayed calls to ShutdownHost(). | 597 // Factory used to safely scope delayed calls to ShutdownHost(). |
| 591 base::WeakPtrFactory<RenderWidgetHostViewMac> weak_factory_; | 598 base::WeakPtrFactory<RenderWidgetHostViewMac> weak_factory_; |
| 592 | 599 |
| 593 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewMac); | 600 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewMac); |
| 594 }; | 601 }; |
| 595 | 602 |
| 596 } // namespace content | 603 } // namespace content |
| 597 | 604 |
| 598 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ | 605 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ |
| OLD | NEW |