Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #import "ui/views/cocoa/bridged_content_view.h" | 5 #import "ui/views/cocoa/bridged_content_view.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #import "base/mac/mac_util.h" | 8 #import "base/mac/mac_util.h" |
| 9 #import "base/mac/scoped_nsobject.h" | 9 #import "base/mac/scoped_nsobject.h" |
| 10 #include "base/strings/sys_string_conversions.h" | 10 #include "base/strings/sys_string_conversions.h" |
| (...skipping 850 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 861 composition.text = base::SysNSStringToUTF16(text); | 861 composition.text = base::SysNSStringToUTF16(text); |
| 862 composition.selection = gfx::Range(selectedRange); | 862 composition.selection = gfx::Range(selectedRange); |
| 863 textInputClient_->SetCompositionText(composition); | 863 textInputClient_->SetCompositionText(composition); |
| 864 } | 864 } |
| 865 | 865 |
| 866 - (void)unmarkText { | 866 - (void)unmarkText { |
| 867 if (textInputClient_) | 867 if (textInputClient_) |
| 868 textInputClient_->ConfirmCompositionText(); | 868 textInputClient_->ConfirmCompositionText(); |
| 869 } | 869 } |
| 870 | 870 |
| 871 // To maximise consistency with the Cocoa browser (mac_views_browser=0), accept | |
|
tapted
2016/03/17 23:57:35
nit: maximize
Patti Lor
2016/03/18 00:19:39
Done.
| |
| 872 // mouse clicks immediately so that clicking Chrome from an inactive window will | |
|
tapted
2016/03/17 23:57:35
`clicking Chrome from an` -> `clicking on`
Patti Lor
2016/03/18 00:19:39
Done.
| |
| 873 // allow the event to be processed. | |
|
tapted
2016/03/17 23:57:34
processed, rather than merely activate the window.
Patti Lor
2016/03/18 00:19:39
Done.
| |
| 874 - (BOOL)acceptsFirstMouse:(NSEvent*)theEvent { | |
|
tapted
2016/03/17 23:57:35
So for ordering, this should come after // NSView
Patti Lor
2016/03/18 00:19:39
Done.
| |
| 875 return YES; | |
| 876 } | |
| 877 | |
| 871 - (NSArray*)validAttributesForMarkedText { | 878 - (NSArray*)validAttributesForMarkedText { |
| 872 return @[]; | 879 return @[]; |
| 873 } | 880 } |
| 874 | 881 |
| 875 // NSUserInterfaceValidations protocol implementation. | 882 // NSUserInterfaceValidations protocol implementation. |
| 876 | 883 |
| 877 - (BOOL)validateUserInterfaceItem:(id<NSValidatedUserInterfaceItem>)item { | 884 - (BOOL)validateUserInterfaceItem:(id<NSValidatedUserInterfaceItem>)item { |
| 878 if (!textInputClient_) | 885 if (!textInputClient_) |
| 879 return NO; | 886 return NO; |
| 880 | 887 |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 904 } | 911 } |
| 905 | 912 |
| 906 return [super accessibilityAttributeValue:attribute]; | 913 return [super accessibilityAttributeValue:attribute]; |
| 907 } | 914 } |
| 908 | 915 |
| 909 - (id)accessibilityHitTest:(NSPoint)point { | 916 - (id)accessibilityHitTest:(NSPoint)point { |
| 910 return [hostedView_->GetNativeViewAccessible() accessibilityHitTest:point]; | 917 return [hostedView_->GetNativeViewAccessible() accessibilityHitTest:point]; |
| 911 } | 918 } |
| 912 | 919 |
| 913 @end | 920 @end |
| OLD | NEW |