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 #include "content/browser/renderer_host/render_widget_host_view_mac.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_mac.h" |
6 | 6 |
7 #include <QuartzCore/QuartzCore.h> | 7 #include <QuartzCore/QuartzCore.h> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 compositing_surface_(gfx::kNullPluginWindow) { | 242 compositing_surface_(gfx::kNullPluginWindow) { |
243 // |cocoa_view_| owns us and we will be deleted when |cocoa_view_| | 243 // |cocoa_view_| owns us and we will be deleted when |cocoa_view_| |
244 // goes away. Since we autorelease it, our caller must put | 244 // goes away. Since we autorelease it, our caller must put |
245 // |GetNativeView()| into the view hierarchy right after calling us. | 245 // |GetNativeView()| into the view hierarchy right after calling us. |
246 cocoa_view_ = [[[RenderWidgetHostViewCocoa alloc] | 246 cocoa_view_ = [[[RenderWidgetHostViewCocoa alloc] |
247 initWithRenderWidgetHostViewMac:this] autorelease]; | 247 initWithRenderWidgetHostViewMac:this] autorelease]; |
248 render_widget_host_->SetView(this); | 248 render_widget_host_->SetView(this); |
249 } | 249 } |
250 | 250 |
251 RenderWidgetHostViewMac::~RenderWidgetHostViewMac() { | 251 RenderWidgetHostViewMac::~RenderWidgetHostViewMac() { |
| 252 UnlockMouse(); |
252 } | 253 } |
253 | 254 |
254 void RenderWidgetHostViewMac::SetDelegate( | 255 void RenderWidgetHostViewMac::SetDelegate( |
255 RenderWidgetHostViewMacDelegate* delegate) { | 256 RenderWidgetHostViewMacDelegate* delegate) { |
256 [cocoa_view_ setRWHVDelegate:delegate]; | 257 [cocoa_view_ setRWHVDelegate:delegate]; |
257 } | 258 } |
258 | 259 |
259 namespace render_widget_host_view_mac { | 260 namespace render_widget_host_view_mac { |
260 RenderWidgetHostView *CreateRenderWidgetHostView(RenderWidgetHost *widget) { | 261 RenderWidgetHostView *CreateRenderWidgetHostView(RenderWidgetHost *widget) { |
261 return new RenderWidgetHostViewMac(widget); | 262 return new RenderWidgetHostViewMac(widget); |
(...skipping 2504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2766 if (!string) return NO; | 2767 if (!string) return NO; |
2767 | 2768 |
2768 // If the user is currently using an IME, confirm the IME input, | 2769 // If the user is currently using an IME, confirm the IME input, |
2769 // and then insert the text from the service, the same as TextEdit and Safari. | 2770 // and then insert the text from the service, the same as TextEdit and Safari. |
2770 [self confirmComposition]; | 2771 [self confirmComposition]; |
2771 [self insertText:string]; | 2772 [self insertText:string]; |
2772 return YES; | 2773 return YES; |
2773 } | 2774 } |
2774 | 2775 |
2775 @end | 2776 @end |
OLD | NEW |