| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #define _USE_MATH_DEFINES // For VC++ to get M_PI. This has to be first. | 5 #define _USE_MATH_DEFINES // For VC++ to get M_PI. This has to be first. |
| 6 | 6 |
| 7 #include "ui/views/view.h" | 7 #include "ui/views/view.h" |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <cmath> | 10 #include <cmath> |
| (...skipping 1398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1409 } | 1409 } |
| 1410 | 1410 |
| 1411 // Accessibility---------------------------------------------------------------- | 1411 // Accessibility---------------------------------------------------------------- |
| 1412 | 1412 |
| 1413 bool View::HandleAccessibleAction(const ui::AXActionData& action_data) { | 1413 bool View::HandleAccessibleAction(const ui::AXActionData& action_data) { |
| 1414 return false; | 1414 return false; |
| 1415 } | 1415 } |
| 1416 | 1416 |
| 1417 gfx::NativeViewAccessible View::GetNativeViewAccessible() { | 1417 gfx::NativeViewAccessible View::GetNativeViewAccessible() { |
| 1418 if (!native_view_accessibility_) | 1418 if (!native_view_accessibility_) |
| 1419 native_view_accessibility_ = NativeViewAccessibility::Create(this); | 1419 native_view_accessibility_ = NativeViewAccessibility::CreateForView(this); |
| 1420 if (native_view_accessibility_) | 1420 if (native_view_accessibility_) |
| 1421 return native_view_accessibility_->GetNativeObject(); | 1421 return native_view_accessibility_->GetNativeObject(); |
| 1422 return nullptr; | 1422 return nullptr; |
| 1423 } | 1423 } |
| 1424 | 1424 |
| 1425 void View::NotifyAccessibilityEvent( | 1425 void View::NotifyAccessibilityEvent( |
| 1426 ui::AXEvent event_type, | 1426 ui::AXEvent event_type, |
| 1427 bool send_native_event) { | 1427 bool send_native_event) { |
| 1428 if (ViewsDelegate::GetInstance()) | 1428 if (ViewsDelegate::GetInstance()) |
| 1429 ViewsDelegate::GetInstance()->NotifyAccessibilityEvent(this, event_type); | 1429 ViewsDelegate::GetInstance()->NotifyAccessibilityEvent(this, event_type); |
| 1430 | 1430 |
| 1431 if (send_native_event && GetWidget()) { | 1431 if (send_native_event && GetWidget()) { |
| 1432 if (!native_view_accessibility_) | 1432 if (!native_view_accessibility_) |
| 1433 native_view_accessibility_ = NativeViewAccessibility::Create(this); | 1433 native_view_accessibility_ = NativeViewAccessibility::CreateForView(this); |
| 1434 if (native_view_accessibility_) | 1434 if (native_view_accessibility_) |
| 1435 native_view_accessibility_->NotifyAccessibilityEvent(event_type); | 1435 native_view_accessibility_->NotifyAccessibilityEvent(event_type); |
| 1436 } | 1436 } |
| 1437 } | 1437 } |
| 1438 | 1438 |
| 1439 // Scrolling ------------------------------------------------------------------- | 1439 // Scrolling ------------------------------------------------------------------- |
| 1440 | 1440 |
| 1441 void View::ScrollRectToVisible(const gfx::Rect& rect) { | 1441 void View::ScrollRectToVisible(const gfx::Rect& rect) { |
| 1442 // We must take RTL UI mirroring into account when adjusting the position of | 1442 // We must take RTL UI mirroring into account when adjusting the position of |
| 1443 // the region. | 1443 // the region. |
| (...skipping 1101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2545 // Message the RootView to do the drag and drop. That way if we're removed | 2545 // Message the RootView to do the drag and drop. That way if we're removed |
| 2546 // the RootView can detect it and avoid calling us back. | 2546 // the RootView can detect it and avoid calling us back. |
| 2547 gfx::Point widget_location(event.location()); | 2547 gfx::Point widget_location(event.location()); |
| 2548 ConvertPointToWidget(this, &widget_location); | 2548 ConvertPointToWidget(this, &widget_location); |
| 2549 widget->RunShellDrag(this, data, widget_location, drag_operations, source); | 2549 widget->RunShellDrag(this, data, widget_location, drag_operations, source); |
| 2550 // WARNING: we may have been deleted. | 2550 // WARNING: we may have been deleted. |
| 2551 return true; | 2551 return true; |
| 2552 } | 2552 } |
| 2553 | 2553 |
| 2554 } // namespace views | 2554 } // namespace views |
| OLD | NEW |