OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ | 5 #ifndef CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ |
6 #define CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ | 6 #define CHROME_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 #import <QuartzCore/CALayer.h> | 10 #import <QuartzCore/CALayer.h> |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 std::vector<WebKit::WebCompositionUnderline> underlines_; | 117 std::vector<WebKit::WebCompositionUnderline> underlines_; |
118 | 118 |
119 // Indicates if doCommandBySelector method receives any edit command when | 119 // Indicates if doCommandBySelector method receives any edit command when |
120 // handling a key down event. | 120 // handling a key down event. |
121 BOOL hasEditCommands_; | 121 BOOL hasEditCommands_; |
122 | 122 |
123 // Contains edit commands received by the -doCommandBySelector: method when | 123 // Contains edit commands received by the -doCommandBySelector: method when |
124 // handling a key down event, not including inserting commands, eg. insertTab, | 124 // handling a key down event, not including inserting commands, eg. insertTab, |
125 // etc. | 125 // etc. |
126 EditCommands editCommands_; | 126 EditCommands editCommands_; |
| 127 |
| 128 // The plugin for which IME is currently enabled (-1 if not enabled). |
| 129 int pluginImeIdentifier_; |
127 } | 130 } |
128 | 131 |
129 @property(assign, nonatomic) NSRect caretRect; | 132 @property(assign, nonatomic) NSRect caretRect; |
130 | 133 |
131 - (void)setCanBeKeyView:(BOOL)can; | 134 - (void)setCanBeKeyView:(BOOL)can; |
132 - (void)setTakesFocusOnlyOnMouseDown:(BOOL)b; | 135 - (void)setTakesFocusOnlyOnMouseDown:(BOOL)b; |
133 - (void)setCloseOnDeactivate:(BOOL)b; | 136 - (void)setCloseOnDeactivate:(BOOL)b; |
134 - (void)setToolTipAtMousePoint:(NSString *)string; | 137 - (void)setToolTipAtMousePoint:(NSString *)string; |
135 // Set frame, then notify the RenderWidgetHost that the frame has been changed, | 138 // Set frame, then notify the RenderWidgetHost that the frame has been changed, |
136 // but do it in a separate task, using |performSelector:withObject:afterDelay:|. | 139 // but do it in a separate task, using |performSelector:withObject:afterDelay:|. |
137 // This stops the flickering issue in http://crbug.com/31970 | 140 // This stops the flickering issue in http://crbug.com/31970 |
138 - (void)setFrameWithDeferredUpdate:(NSRect)frame; | 141 - (void)setFrameWithDeferredUpdate:(NSRect)frame; |
139 // Notify the RenderWidgetHost that the frame was updated so it can resize | 142 // Notify the RenderWidgetHost that the frame was updated so it can resize |
140 // its contents. | 143 // its contents. |
141 - (void)renderWidgetHostWasResized; | 144 - (void)renderWidgetHostWasResized; |
142 // Cancel ongoing composition (abandon the marked text). | 145 // Cancel ongoing composition (abandon the marked text). |
143 - (void)cancelComposition; | 146 - (void)cancelComposition; |
144 // Set the new accessibility tree. | 147 // Set the new accessibility tree. |
145 - (void)setAccessibilityTreeRoot:(BrowserAccessibility*) treeRoot; | 148 - (void)setAccessibilityTreeRoot:(BrowserAccessibility*) treeRoot; |
146 // Confirm ongoing composition. | 149 // Confirm ongoing composition. |
147 - (void)confirmComposition; | 150 - (void)confirmComposition; |
| 151 // Enables or disables plugin IME for the given plugin. |
| 152 - (void)setPluginImeEnabled:(BOOL)enabled forPlugin:(int)pluginId; |
| 153 // Evaluates the event in the context of plugin IME, if plugin IME is enabled. |
| 154 // Returns YES if the event was handled. |
| 155 - (BOOL)postProcessEventForPluginIme:(NSEvent*)event; |
148 | 156 |
149 @end | 157 @end |
150 | 158 |
151 /////////////////////////////////////////////////////////////////////////////// | 159 /////////////////////////////////////////////////////////////////////////////// |
152 // RenderWidgetHostViewMac | 160 // RenderWidgetHostViewMac |
153 // | 161 // |
154 // An object representing the "View" of a rendered web page. This object is | 162 // An object representing the "View" of a rendered web page. This object is |
155 // responsible for displaying the content of the web page, and integrating with | 163 // responsible for displaying the content of the web page, and integrating with |
156 // the Cocoa view system. It is the implementation of the RenderWidgetHostView | 164 // the Cocoa view system. It is the implementation of the RenderWidgetHostView |
157 // that the cross-platform RenderWidgetHost object uses | 165 // that the cross-platform RenderWidgetHost object uses |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 virtual gfx::Rect GetRootWindowRect(); | 225 virtual gfx::Rect GetRootWindowRect(); |
218 virtual void SetActive(bool active); | 226 virtual void SetActive(bool active); |
219 virtual void SetWindowVisibility(bool visible); | 227 virtual void SetWindowVisibility(bool visible); |
220 virtual void WindowFrameChanged(); | 228 virtual void WindowFrameChanged(); |
221 virtual void SetBackground(const SkBitmap& background); | 229 virtual void SetBackground(const SkBitmap& background); |
222 virtual bool ContainsNativeView(gfx::NativeView native_view) const; | 230 virtual bool ContainsNativeView(gfx::NativeView native_view) const; |
223 | 231 |
224 virtual void OnAccessibilityNotifications( | 232 virtual void OnAccessibilityNotifications( |
225 const std::vector<ViewHostMsg_AccessibilityNotification_Params>& params); | 233 const std::vector<ViewHostMsg_AccessibilityNotification_Params>& params); |
226 | 234 |
| 235 virtual void SetPluginImeEnabled(bool enabled, int plugin_id); |
| 236 virtual bool PostProcessEventForPluginIme( |
| 237 const NativeWebKeyboardEvent& event); |
| 238 |
227 // Methods associated with GPU-accelerated plug-in instances and the | 239 // Methods associated with GPU-accelerated plug-in instances and the |
228 // accelerated compositor. | 240 // accelerated compositor. |
229 virtual gfx::PluginWindowHandle AllocateFakePluginWindowHandle(bool opaque, | 241 virtual gfx::PluginWindowHandle AllocateFakePluginWindowHandle(bool opaque, |
230 bool root); | 242 bool root); |
231 virtual void DestroyFakePluginWindowHandle(gfx::PluginWindowHandle window); | 243 virtual void DestroyFakePluginWindowHandle(gfx::PluginWindowHandle window); |
232 | 244 |
233 // Helper to do the actual cleanup after a plugin handle has been destroyed. | 245 // Helper to do the actual cleanup after a plugin handle has been destroyed. |
234 // Required because DestroyFakePluginWindowHandle() isn't always called for | 246 // Required because DestroyFakePluginWindowHandle() isn't always called for |
235 // all handles (it's e.g. not called on navigation, when the RWHVMac gets | 247 // all handles (it's e.g. not called on navigation, when the RWHVMac gets |
236 // destroyed anyway). | 248 // destroyed anyway). |
(...skipping 19 matching lines...) Expand all Loading... |
256 void ForceTextureReload(); | 268 void ForceTextureReload(); |
257 | 269 |
258 virtual void SetVisuallyDeemphasized(bool deemphasized); | 270 virtual void SetVisuallyDeemphasized(bool deemphasized); |
259 | 271 |
260 void KillSelf(); | 272 void KillSelf(); |
261 | 273 |
262 void set_parent_view(NSView* parent_view) { parent_view_ = parent_view; } | 274 void set_parent_view(NSView* parent_view) { parent_view_ = parent_view; } |
263 | 275 |
264 void SetTextInputActive(bool active); | 276 void SetTextInputActive(bool active); |
265 | 277 |
| 278 // Sends confirmed plugin IME text back to the renderer. |
| 279 void PluginImeCompositionConfirmed(const string16& text, int plugin_id); |
| 280 |
266 const std::string& selected_text() const { return selected_text_; } | 281 const std::string& selected_text() const { return selected_text_; } |
267 | 282 |
268 // These member variables should be private, but the associated ObjC class | 283 // These member variables should be private, but the associated ObjC class |
269 // needs access to them and can't be made a friend. | 284 // needs access to them and can't be made a friend. |
270 | 285 |
271 // The associated Model. Can be NULL if Destroy() is called when | 286 // The associated Model. Can be NULL if Destroy() is called when |
272 // someone (other than superview) has retained |cocoa_view_|. | 287 // someone (other than superview) has retained |cocoa_view_|. |
273 RenderWidgetHost* render_widget_host_; | 288 RenderWidgetHost* render_widget_host_; |
274 | 289 |
275 // This is true when we are currently painting and thus should handle extra | 290 // This is true when we are currently painting and thus should handle extra |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 // Used for positioning a popup menu. | 363 // Used for positioning a popup menu. |
349 NSView* parent_view_; | 364 NSView* parent_view_; |
350 | 365 |
351 // selected text on the renderer. | 366 // selected text on the renderer. |
352 std::string selected_text_; | 367 std::string selected_text_; |
353 | 368 |
354 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewMac); | 369 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewMac); |
355 }; | 370 }; |
356 | 371 |
357 #endif // CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ | 372 #endif // CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ |
OLD | NEW |