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/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
517 | 517 |
518 void RenderWidgetHostViewMac::Blur() { | 518 void RenderWidgetHostViewMac::Blur() { |
519 UnlockMouse(); | 519 UnlockMouse(); |
520 [[cocoa_view_ window] makeFirstResponder:nil]; | 520 [[cocoa_view_ window] makeFirstResponder:nil]; |
521 } | 521 } |
522 | 522 |
523 bool RenderWidgetHostViewMac::HasFocus() const { | 523 bool RenderWidgetHostViewMac::HasFocus() const { |
524 return [[cocoa_view_ window] firstResponder] == cocoa_view_; | 524 return [[cocoa_view_ window] firstResponder] == cocoa_view_; |
525 } | 525 } |
526 | 526 |
| 527 bool RenderWidgetHostViewMac::IsSurfaceAvailableForCopy() const { |
| 528 return !!render_widget_host_->GetBackingStore(false) || |
| 529 (compositing_iosurface_.get() && compositing_iosurface_->HasIOSurface()); |
| 530 } |
| 531 |
527 void RenderWidgetHostViewMac::Show() { | 532 void RenderWidgetHostViewMac::Show() { |
528 [cocoa_view_ setHidden:NO]; | 533 [cocoa_view_ setHidden:NO]; |
529 | 534 |
530 DidBecomeSelected(); | 535 DidBecomeSelected(); |
531 } | 536 } |
532 | 537 |
533 void RenderWidgetHostViewMac::Hide() { | 538 void RenderWidgetHostViewMac::Hide() { |
534 [cocoa_view_ setHidden:YES]; | 539 [cocoa_view_ setHidden:YES]; |
535 | 540 |
536 WasHidden(); | 541 WasHidden(); |
(...skipping 2406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2943 if (!string) return NO; | 2948 if (!string) return NO; |
2944 | 2949 |
2945 // If the user is currently using an IME, confirm the IME input, | 2950 // If the user is currently using an IME, confirm the IME input, |
2946 // and then insert the text from the service, the same as TextEdit and Safari. | 2951 // and then insert the text from the service, the same as TextEdit and Safari. |
2947 [self confirmComposition]; | 2952 [self confirmComposition]; |
2948 [self insertText:string]; | 2953 [self insertText:string]; |
2949 return YES; | 2954 return YES; |
2950 } | 2955 } |
2951 | 2956 |
2952 @end | 2957 @end |
OLD | NEW |