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 #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 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 507 | 507 |
| 508 void RenderWidgetHostViewMac::Blur() { | 508 void RenderWidgetHostViewMac::Blur() { |
| 509 UnlockMouse(); | 509 UnlockMouse(); |
| 510 [[cocoa_view_ window] makeFirstResponder:nil]; | 510 [[cocoa_view_ window] makeFirstResponder:nil]; |
| 511 } | 511 } |
| 512 | 512 |
| 513 bool RenderWidgetHostViewMac::HasFocus() const { | 513 bool RenderWidgetHostViewMac::HasFocus() const { |
| 514 return [[cocoa_view_ window] firstResponder] == cocoa_view_; | 514 return [[cocoa_view_ window] firstResponder] == cocoa_view_; |
| 515 } | 515 } |
| 516 | 516 |
| 517 bool RenderWidgetHostViewMac::HasSurface() const { | |
| 518 return compositing_iosurface_.get() && compositing_iosurface_->HasIOSurface(); | |
|
mazda
2012/05/03 20:19:34
Sorry, I omitted the check of the backing store in
| |
| 519 } | |
| 520 | |
| 517 void RenderWidgetHostViewMac::Show() { | 521 void RenderWidgetHostViewMac::Show() { |
| 518 [cocoa_view_ setHidden:NO]; | 522 [cocoa_view_ setHidden:NO]; |
| 519 | 523 |
| 520 DidBecomeSelected(); | 524 DidBecomeSelected(); |
| 521 } | 525 } |
| 522 | 526 |
| 523 void RenderWidgetHostViewMac::Hide() { | 527 void RenderWidgetHostViewMac::Hide() { |
| 524 [cocoa_view_ setHidden:YES]; | 528 [cocoa_view_ setHidden:YES]; |
| 525 | 529 |
| 526 WasHidden(); | 530 WasHidden(); |
| (...skipping 2370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2897 if (!string) return NO; | 2901 if (!string) return NO; |
| 2898 | 2902 |
| 2899 // If the user is currently using an IME, confirm the IME input, | 2903 // If the user is currently using an IME, confirm the IME input, |
| 2900 // and then insert the text from the service, the same as TextEdit and Safari. | 2904 // and then insert the text from the service, the same as TextEdit and Safari. |
| 2901 [self confirmComposition]; | 2905 [self confirmComposition]; |
| 2902 [self insertText:string]; | 2906 [self insertText:string]; |
| 2903 return YES; | 2907 return YES; |
| 2904 } | 2908 } |
| 2905 | 2909 |
| 2906 @end | 2910 @end |
| OLD | NEW |