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 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 hostedView_->GetWidget()->OnMouseEvent(&event); | 325 hostedView_->GetWidget()->OnMouseEvent(&event); |
326 } | 326 } |
327 | 327 |
328 - (void)updateTooltipIfRequiredAt:(const gfx::Point&)locationInContent { | 328 - (void)updateTooltipIfRequiredAt:(const gfx::Point&)locationInContent { |
329 DCHECK(hostedView_); | 329 DCHECK(hostedView_); |
330 base::string16 newTooltipText; | 330 base::string16 newTooltipText; |
331 | 331 |
332 views::View* view = hostedView_->GetTooltipHandlerForPoint(locationInContent); | 332 views::View* view = hostedView_->GetTooltipHandlerForPoint(locationInContent); |
333 if (view) { | 333 if (view) { |
334 gfx::Point viewPoint = locationInContent; | 334 gfx::Point viewPoint = locationInContent; |
335 views::View::ConvertPointToTarget(hostedView_, view, &viewPoint); | 335 views::View::ConvertPointToScreen(hostedView_, &viewPoint); |
| 336 views::View::ConvertPointFromScreen(view, &viewPoint); |
336 if (!view->GetTooltipText(viewPoint, &newTooltipText)) | 337 if (!view->GetTooltipText(viewPoint, &newTooltipText)) |
337 DCHECK(newTooltipText.empty()); | 338 DCHECK(newTooltipText.empty()); |
338 } | 339 } |
339 if (newTooltipText != lastTooltipText_) { | 340 if (newTooltipText != lastTooltipText_) { |
340 std::swap(newTooltipText, lastTooltipText_); | 341 std::swap(newTooltipText, lastTooltipText_); |
341 [self setToolTipAtMousePoint:base::SysUTF16ToNSString(lastTooltipText_)]; | 342 [self setToolTipAtMousePoint:base::SysUTF16ToNSString(lastTooltipText_)]; |
342 } | 343 } |
343 } | 344 } |
344 | 345 |
345 - (void)updateWindowMask { | 346 - (void)updateWindowMask { |
(...skipping 934 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1280 } | 1281 } |
1281 | 1282 |
1282 return [super accessibilityAttributeValue:attribute]; | 1283 return [super accessibilityAttributeValue:attribute]; |
1283 } | 1284 } |
1284 | 1285 |
1285 - (id)accessibilityHitTest:(NSPoint)point { | 1286 - (id)accessibilityHitTest:(NSPoint)point { |
1286 return [hostedView_->GetNativeViewAccessible() accessibilityHitTest:point]; | 1287 return [hostedView_->GetNativeViewAccessible() accessibilityHitTest:point]; |
1287 } | 1288 } |
1288 | 1289 |
1289 @end | 1290 @end |
OLD | NEW |