| 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::IsSurfaceAvailableForCopy() const { |
| 518 return !!render_widget_host_->GetBackingStore(false) || |
| 519 (compositing_iosurface_.get() && compositing_iosurface_->HasIOSurface()); |
| 520 } |
| 521 |
| 517 void RenderWidgetHostViewMac::Show() { | 522 void RenderWidgetHostViewMac::Show() { |
| 518 [cocoa_view_ setHidden:NO]; | 523 [cocoa_view_ setHidden:NO]; |
| 519 | 524 |
| 520 DidBecomeSelected(); | 525 DidBecomeSelected(); |
| 521 } | 526 } |
| 522 | 527 |
| 523 void RenderWidgetHostViewMac::Hide() { | 528 void RenderWidgetHostViewMac::Hide() { |
| 524 [cocoa_view_ setHidden:YES]; | 529 [cocoa_view_ setHidden:YES]; |
| 525 | 530 |
| 526 WasHidden(); | 531 WasHidden(); |
| (...skipping 2370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2897 if (!string) return NO; | 2902 if (!string) return NO; |
| 2898 | 2903 |
| 2899 // If the user is currently using an IME, confirm the IME input, | 2904 // 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. | 2905 // and then insert the text from the service, the same as TextEdit and Safari. |
| 2901 [self confirmComposition]; | 2906 [self confirmComposition]; |
| 2902 [self insertText:string]; | 2907 [self insertText:string]; |
| 2903 return YES; | 2908 return YES; |
| 2904 } | 2909 } |
| 2905 | 2910 |
| 2906 @end | 2911 @end |
| OLD | NEW |