| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <QuartzCore/QuartzCore.h> | 5 #include <QuartzCore/QuartzCore.h> |
| 6 | 6 |
| 7 #include "chrome/browser/renderer_host/render_widget_host_view_mac.h" | 7 #include "chrome/browser/renderer_host/render_widget_host_view_mac.h" |
| 8 | 8 |
| 9 #include "app/app_switches.h" | 9 #include "app/app_switches.h" |
| 10 #include "app/surface/io_surface_support_mac.h" | 10 #include "app/surface/io_surface_support_mac.h" |
| (...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 402 | 402 |
| 403 - (void)setFrame:(NSRect)frameRect { | 403 - (void)setFrame:(NSRect)frameRect { |
| 404 [self setCachedSize:frameRect.size]; | 404 [self setCachedSize:frameRect.size]; |
| 405 [super setFrame:frameRect]; | 405 [super setFrame:frameRect]; |
| 406 } | 406 } |
| 407 | 407 |
| 408 - (void)setFrameSize:(NSSize)newSize { | 408 - (void)setFrameSize:(NSSize)newSize { |
| 409 [self setCachedSize:newSize]; | 409 [self setCachedSize:newSize]; |
| 410 [super setFrameSize:newSize]; | 410 [super setFrameSize:newSize]; |
| 411 } | 411 } |
| 412 |
| 413 - (BOOL)acceptsFirstResponder { |
| 414 // Accept first responder if the first responder isn't the RWHVMac. |
| 415 return [[self window] firstResponder] != [self superview]; |
| 416 } |
| 417 |
| 418 - (BOOL)becomeFirstResponder { |
| 419 // Delegate first responder to the RWHVMac. |
| 420 [[self window] makeFirstResponder:[self superview]]; |
| 421 return YES; |
| 422 } |
| 412 @end | 423 @end |
| 413 | 424 |
| 414 // RenderWidgetHostView -------------------------------------------------------- | 425 // RenderWidgetHostView -------------------------------------------------------- |
| 415 | 426 |
| 416 // static | 427 // static |
| 417 RenderWidgetHostView* RenderWidgetHostView::CreateViewForWidget( | 428 RenderWidgetHostView* RenderWidgetHostView::CreateViewForWidget( |
| 418 RenderWidgetHost* widget) { | 429 RenderWidgetHost* widget) { |
| 419 return new RenderWidgetHostViewMac(widget); | 430 return new RenderWidgetHostViewMac(widget); |
| 420 } | 431 } |
| 421 | 432 |
| (...skipping 2101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2523 if (!string) return NO; | 2534 if (!string) return NO; |
| 2524 | 2535 |
| 2525 // If the user is currently using an IME, confirm the IME input, | 2536 // If the user is currently using an IME, confirm the IME input, |
| 2526 // and then insert the text from the service, the same as TextEdit and Safari. | 2537 // and then insert the text from the service, the same as TextEdit and Safari. |
| 2527 [self confirmComposition]; | 2538 [self confirmComposition]; |
| 2528 [self insertText:string]; | 2539 [self insertText:string]; |
| 2529 return YES; | 2540 return YES; |
| 2530 } | 2541 } |
| 2531 | 2542 |
| 2532 @end | 2543 @end |
| OLD | NEW |