| 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 #import "base/mac/sdk_forward_declarations.h" | 10 #import "base/mac/sdk_forward_declarations.h" |
| (...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 309 DCHECK(bounds.origin().IsOrigin()); | 309 DCHECK(bounds.origin().IsOrigin()); |
| 310 NSRect initialFrame = NSMakeRect(0, 0, bounds.width(), bounds.height()); | 310 NSRect initialFrame = NSMakeRect(0, 0, bounds.width(), bounds.height()); |
| 311 if ((self = [super initWithFrame:initialFrame])) { | 311 if ((self = [super initWithFrame:initialFrame])) { |
| 312 hostedView_ = viewToHost; | 312 hostedView_ = viewToHost; |
| 313 | 313 |
| 314 // Apple's documentation says that NSTrackingActiveAlways is incompatible | 314 // Apple's documentation says that NSTrackingActiveAlways is incompatible |
| 315 // with NSTrackingCursorUpdate, so use NSTrackingActiveInActiveApp. | 315 // with NSTrackingCursorUpdate, so use NSTrackingActiveInActiveApp. |
| 316 cursorTrackingArea_.reset([[CrTrackingArea alloc] | 316 cursorTrackingArea_.reset([[CrTrackingArea alloc] |
| 317 initWithRect:NSZeroRect | 317 initWithRect:NSZeroRect |
| 318 options:NSTrackingMouseMoved | NSTrackingCursorUpdate | | 318 options:NSTrackingMouseMoved | NSTrackingCursorUpdate | |
| 319 NSTrackingActiveInActiveApp | NSTrackingInVisibleRect | 319 NSTrackingActiveInActiveApp | NSTrackingInVisibleRect | |
| 320 NSTrackingMouseEnteredAndExited |
| 320 owner:self | 321 owner:self |
| 321 userInfo:nil]); | 322 userInfo:nil]); |
| 322 [self addTrackingArea:cursorTrackingArea_.get()]; | 323 [self addTrackingArea:cursorTrackingArea_.get()]; |
| 323 | 324 |
| 324 // Get notified whenever Full Keyboard Access mode is changed. | 325 // Get notified whenever Full Keyboard Access mode is changed. |
| 325 [[NSDistributedNotificationCenter defaultCenter] | 326 [[NSDistributedNotificationCenter defaultCenter] |
| 326 addObserver:self | 327 addObserver:self |
| 327 selector:@selector(onFullKeyboardAccessModeChanged:) | 328 selector:@selector(onFullKeyboardAccessModeChanged:) |
| 328 name:kFullKeyboardAccessChangedNotification | 329 name:kFullKeyboardAccessChangedNotification |
| 329 object:nil]; | 330 object:nil]; |
| (...skipping 1102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1432 return [hostedView_->GetNativeViewAccessible() accessibilityHitTest:point]; | 1433 return [hostedView_->GetNativeViewAccessible() accessibilityHitTest:point]; |
| 1433 } | 1434 } |
| 1434 | 1435 |
| 1435 - (id)accessibilityFocusedUIElement { | 1436 - (id)accessibilityFocusedUIElement { |
| 1436 if (!hostedView_) | 1437 if (!hostedView_) |
| 1437 return nil; | 1438 return nil; |
| 1438 return [hostedView_->GetNativeViewAccessible() accessibilityFocusedUIElement]; | 1439 return [hostedView_->GetNativeViewAccessible() accessibilityFocusedUIElement]; |
| 1439 } | 1440 } |
| 1440 | 1441 |
| 1441 @end | 1442 @end |
| OLD | NEW |