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 1313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1324 return native_view_accessibility_->GetNativeObject(); | 1324 return native_view_accessibility_->GetNativeObject(); |
1325 return NULL; | 1325 return NULL; |
1326 } | 1326 } |
1327 | 1327 |
1328 void View::NotifyAccessibilityEvent( | 1328 void View::NotifyAccessibilityEvent( |
1329 ui::AccessibilityTypes::Event event_type, | 1329 ui::AccessibilityTypes::Event event_type, |
1330 bool send_native_event) { | 1330 bool send_native_event) { |
1331 if (ViewsDelegate::views_delegate) | 1331 if (ViewsDelegate::views_delegate) |
1332 ViewsDelegate::views_delegate->NotifyAccessibilityEvent(this, event_type); | 1332 ViewsDelegate::views_delegate->NotifyAccessibilityEvent(this, event_type); |
1333 | 1333 |
1334 if (send_native_event) { | 1334 if (send_native_event && GetWidget()) { |
1335 if (!native_view_accessibility_) | 1335 if (!native_view_accessibility_) |
1336 native_view_accessibility_ = NativeViewAccessibility::Create(this); | 1336 native_view_accessibility_ = NativeViewAccessibility::Create(this); |
1337 if (native_view_accessibility_) | 1337 if (native_view_accessibility_) |
1338 native_view_accessibility_->NotifyAccessibilityEvent(event_type); | 1338 native_view_accessibility_->NotifyAccessibilityEvent(event_type); |
1339 } | 1339 } |
1340 } | 1340 } |
1341 | 1341 |
1342 // Scrolling ------------------------------------------------------------------- | 1342 // Scrolling ------------------------------------------------------------------- |
1343 | 1343 |
1344 void View::ScrollRectToVisible(const gfx::Rect& rect) { | 1344 void View::ScrollRectToVisible(const gfx::Rect& rect) { |
(...skipping 1042 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2387 // Message the RootView to do the drag and drop. That way if we're removed | 2387 // Message the RootView to do the drag and drop. That way if we're removed |
2388 // the RootView can detect it and avoid calling us back. | 2388 // the RootView can detect it and avoid calling us back. |
2389 gfx::Point widget_location(event.location()); | 2389 gfx::Point widget_location(event.location()); |
2390 ConvertPointToWidget(this, &widget_location); | 2390 ConvertPointToWidget(this, &widget_location); |
2391 widget->RunShellDrag(this, data, widget_location, drag_operations, source); | 2391 widget->RunShellDrag(this, data, widget_location, drag_operations, source); |
2392 // WARNING: we may have been deleted. | 2392 // WARNING: we may have been deleted. |
2393 return true; | 2393 return true; |
2394 } | 2394 } |
2395 | 2395 |
2396 } // namespace views | 2396 } // namespace views |
OLD | NEW |