Chromium Code Reviews| Index: ui/views/accessibility/native_view_accessibility.cc |
| diff --git a/ui/views/accessibility/native_view_accessibility.cc b/ui/views/accessibility/native_view_accessibility.cc |
| index 409ac5a80e802e46f6db09e2a8bbbb0cbce44b65..a362e75d45ac014c861fd1344fa1b2f6033a1ca0 100644 |
| --- a/ui/views/accessibility/native_view_accessibility.cc |
| +++ b/ui/views/accessibility/native_view_accessibility.cc |
| @@ -4,6 +4,7 @@ |
| #include "ui/views/accessibility/native_view_accessibility.h" |
| +#include "base/memory/ptr_util.h" |
| #include "base/strings/utf_string_conversions.h" |
| #include "ui/events/event_utils.h" |
| #include "ui/gfx/native_widget_types.h" |
| @@ -15,8 +16,10 @@ namespace views { |
| #if !defined(PLATFORM_HAS_NATIVE_VIEW_ACCESSIBILITY_IMPL) |
| // static |
| -NativeViewAccessibility* NativeViewAccessibility::Create(View* view) { |
| - return new NativeViewAccessibility(view); |
| +std::unique_ptr<NativeViewAccessibility> NativeViewAccessibility::Create( |
| + View* view) { |
| + return base::WrapUnique<NativeViewAccessibility>( |
|
tapted
2017/02/28 06:29:12
nit: Comment here like
// Use WrapUnique rather t
Patti Lor
2017/02/28 22:24:24
Done - sorry, I forgot :(
|
| + new NativeViewAccessibility(view)); |
| } |
| #endif // !defined(PLATFORM_HAS_NATIVE_VIEW_ACCESSIBILITY_IMPL) |
| @@ -38,10 +41,6 @@ gfx::NativeViewAccessible NativeViewAccessibility::GetNativeObject() { |
| return ax_node_ ? ax_node_->GetNativeViewAccessible() : nullptr; |
| } |
| -void NativeViewAccessibility::Destroy() { |
| - delete this; |
| -} |
| - |
| void NativeViewAccessibility::NotifyAccessibilityEvent(ui::AXEvent event_type) { |
| if (ax_node_) |
| ax_node_->NotifyAccessibilityEvent(event_type); |