OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
418 | 418 |
419 void RenderWidgetHostViewMac::Focus() { | 419 void RenderWidgetHostViewMac::Focus() { |
420 [[cocoa_view_ window] makeFirstResponder:cocoa_view_]; | 420 [[cocoa_view_ window] makeFirstResponder:cocoa_view_]; |
421 } | 421 } |
422 | 422 |
423 void RenderWidgetHostViewMac::Blur() { | 423 void RenderWidgetHostViewMac::Blur() { |
424 UnlockMouse(); | 424 UnlockMouse(); |
425 [[cocoa_view_ window] makeFirstResponder:nil]; | 425 [[cocoa_view_ window] makeFirstResponder:nil]; |
426 } | 426 } |
427 | 427 |
428 bool RenderWidgetHostViewMac::HasFocus() { | 428 bool RenderWidgetHostViewMac::HasFocus() const { |
429 return [[cocoa_view_ window] firstResponder] == cocoa_view_; | 429 return [[cocoa_view_ window] firstResponder] == cocoa_view_; |
430 } | 430 } |
431 | 431 |
432 void RenderWidgetHostViewMac::Show() { | 432 void RenderWidgetHostViewMac::Show() { |
433 [cocoa_view_ setHidden:NO]; | 433 [cocoa_view_ setHidden:NO]; |
434 | 434 |
435 DidBecomeSelected(); | 435 DidBecomeSelected(); |
436 } | 436 } |
437 | 437 |
438 void RenderWidgetHostViewMac::Hide() { | 438 void RenderWidgetHostViewMac::Hide() { |
(...skipping 2309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2748 if (!string) return NO; | 2748 if (!string) return NO; |
2749 | 2749 |
2750 // If the user is currently using an IME, confirm the IME input, | 2750 // If the user is currently using an IME, confirm the IME input, |
2751 // and then insert the text from the service, the same as TextEdit and Safari. | 2751 // and then insert the text from the service, the same as TextEdit and Safari. |
2752 [self confirmComposition]; | 2752 [self confirmComposition]; |
2753 [self insertText:string]; | 2753 [self insertText:string]; |
2754 return YES; | 2754 return YES; |
2755 } | 2755 } |
2756 | 2756 |
2757 @end | 2757 @end |
OLD | NEW |