| Index: ui/views/cocoa/bridged_content_view.mm
|
| diff --git a/ui/views/cocoa/bridged_content_view.mm b/ui/views/cocoa/bridged_content_view.mm
|
| index 7fe03cabdef92cc789699397a56e080bc203f291..a3a6884d22a56f9f25b4c8021251384273fb0aa2 100644
|
| --- a/ui/views/cocoa/bridged_content_view.mm
|
| +++ b/ui/views/cocoa/bridged_content_view.mm
|
| @@ -35,6 +35,22 @@
|
|
|
| using views::MenuController;
|
|
|
| +@interface TextShim : NSText {
|
| + BridgedContentView* owner_;
|
| +}
|
| +@end
|
| +
|
| +@implementation TextShim
|
| +
|
| +- (id)initWithOwner:(BridgedContentView*)owner {
|
| + if ((self = [super initWithFrame:NSZeroRect])) {
|
| + owner_ = owner;
|
| + }
|
| + return self;
|
| +}
|
| +
|
| +@end
|
| +
|
| namespace {
|
|
|
| NSString* const kFullKeyboardAccessChangedNotification =
|
| @@ -271,6 +287,8 @@ base::string16 AttributedSubstringForRangeHelper(
|
| userInfo:nil]);
|
| [self addTrackingArea:cursorTrackingArea_.get()];
|
|
|
| + textBridge_.reset([[TextShim alloc] initWithOwner:self]);
|
| +
|
| // Get notified whenever Full Keyboard Access mode is changed.
|
| [[NSDistributedNotificationCenter defaultCenter]
|
| addObserver:self
|
| @@ -366,6 +384,12 @@ base::string16 AttributedSubstringForRangeHelper(
|
| focusManager->SetKeyboardAccessible([NSApp isFullKeyboardAccessEnabled]);
|
| }
|
|
|
| +- (NSView*)contextMenuView {
|
| + if (textInputClient_)
|
| + return textBridge_;
|
| + return self;
|
| +}
|
| +
|
| // BridgedContentView private implementation.
|
|
|
| - (void)handleKeyEvent:(NSEvent*)theEvent {
|
| @@ -1014,6 +1038,7 @@ base::string16 AttributedSubstringForRangeHelper(
|
| // or (string, string).
|
| BOOL valid = textInputClient_ && ((canWrite && (canRead || !returnType)) ||
|
| (canRead && (canWrite || !sendType)));
|
| + //NOTREACHED();
|
| return valid ? self : [super validRequestorForSendType:sendType
|
| returnType:returnType];
|
| }
|
|
|