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

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

Issue 3782012: Merge 62820 - Implement IME for Mac plugins using the Cocoa event model on 10... (Closed) Base URL: svn://svn.chromium.org/chrome/branches/552/src/
Patch Set: Created 10 years, 2 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 | Annotate | Revision Log
OLDNEW
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
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)setAccessibilityTree:(const webkit_glue::WebAccessibility&) tree; 148 - (void)setAccessibilityTree:(const webkit_glue::WebAccessibility&) tree;
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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 bool right_aligned); 223 bool right_aligned);
216 virtual gfx::Rect GetWindowRect(); 224 virtual gfx::Rect GetWindowRect();
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 virtual void UpdateAccessibilityTree( 231 virtual void UpdateAccessibilityTree(
224 const webkit_glue::WebAccessibility& tree); 232 const webkit_glue::WebAccessibility& tree);
233 virtual void SetPluginImeEnabled(bool enabled, int plugin_id);
234 virtual bool PostProcessEventForPluginIme(
235 const NativeWebKeyboardEvent& event);
236
225 // Methods associated with GPU-accelerated plug-in instances and the 237 // Methods associated with GPU-accelerated plug-in instances and the
226 // accelerated compositor. 238 // accelerated compositor.
227 virtual gfx::PluginWindowHandle AllocateFakePluginWindowHandle(bool opaque, 239 virtual gfx::PluginWindowHandle AllocateFakePluginWindowHandle(bool opaque,
228 bool root); 240 bool root);
229 virtual void DestroyFakePluginWindowHandle(gfx::PluginWindowHandle window); 241 virtual void DestroyFakePluginWindowHandle(gfx::PluginWindowHandle window);
230 242
231 // Helper to do the actual cleanup after a plugin handle has been destroyed. 243 // Helper to do the actual cleanup after a plugin handle has been destroyed.
232 // Required because DestroyFakePluginWindowHandle() isn't always called for 244 // Required because DestroyFakePluginWindowHandle() isn't always called for
233 // all handles (it's e.g. not called on navigation, when the RWHVMac gets 245 // all handles (it's e.g. not called on navigation, when the RWHVMac gets
234 // destroyed anyway). 246 // destroyed anyway).
(...skipping 19 matching lines...) Expand all
254 void ForceTextureReload(); 266 void ForceTextureReload();
255 267
256 virtual void SetVisuallyDeemphasized(bool deemphasized); 268 virtual void SetVisuallyDeemphasized(bool deemphasized);
257 269
258 void KillSelf(); 270 void KillSelf();
259 271
260 void set_parent_view(NSView* parent_view) { parent_view_ = parent_view; } 272 void set_parent_view(NSView* parent_view) { parent_view_ = parent_view; }
261 273
262 void SetTextInputActive(bool active); 274 void SetTextInputActive(bool active);
263 275
276 // Sends confirmed plugin IME text back to the renderer.
277 void PluginImeCompositionConfirmed(const string16& text, int plugin_id);
278
264 const std::string& selected_text() const { return selected_text_; } 279 const std::string& selected_text() const { return selected_text_; }
265 280
266 // These member variables should be private, but the associated ObjC class 281 // These member variables should be private, but the associated ObjC class
267 // needs access to them and can't be made a friend. 282 // needs access to them and can't be made a friend.
268 283
269 // The associated Model. Can be NULL if Destroy() is called when 284 // The associated Model. Can be NULL if Destroy() is called when
270 // someone (other than superview) has retained |cocoa_view_|. 285 // someone (other than superview) has retained |cocoa_view_|.
271 RenderWidgetHost* render_widget_host_; 286 RenderWidgetHost* render_widget_host_;
272 287
273 // This is true when we are currently painting and thus should handle extra 288 // This is true when we are currently painting and thus should handle extra
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 // Whether or not web accessibility is enabled. 362 // Whether or not web accessibility is enabled.
348 bool renderer_accessible_; 363 bool renderer_accessible_;
349 364
350 // selected text on the renderer. 365 // selected text on the renderer.
351 std::string selected_text_; 366 std::string selected_text_;
352 367
353 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewMac); 368 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewMac);
354 }; 369 };
355 370
356 #endif // CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ 371 #endif // CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_
OLDNEW
« no previous file with comments | « chrome/browser/renderer_host/render_widget_host_view.h ('k') | chrome/browser/renderer_host/render_widget_host_view_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698