| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 #include "ui/views/accessibility/native_view_accessibility_base.h" | 5 #include "ui/views/accessibility/native_view_accessibility_base.h" |
| 6 | 6 |
| 7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "ui/events/event_utils.h" | 9 #include "ui/events/event_utils.h" |
| 10 #include "ui/gfx/native_widget_types.h" | 10 #include "ui/gfx/native_widget_types.h" |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 return view_->HandleAccessibleAction(data); | 198 return view_->HandleAccessibleAction(data); |
| 199 break; | 199 break; |
| 200 } | 200 } |
| 201 return false; | 201 return false; |
| 202 } | 202 } |
| 203 | 203 |
| 204 void NativeViewAccessibilityBase::DoDefaultAction() { | 204 void NativeViewAccessibilityBase::DoDefaultAction() { |
| 205 gfx::Point center = view_->GetLocalBounds().CenterPoint(); | 205 gfx::Point center = view_->GetLocalBounds().CenterPoint(); |
| 206 view_->OnMousePressed(ui::MouseEvent( | 206 view_->OnMousePressed(ui::MouseEvent( |
| 207 ui::ET_MOUSE_PRESSED, center, center, ui::EventTimeForNow(), | 207 ui::ET_MOUSE_PRESSED, center, center, ui::EventTimeForNow(), |
| 208 ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON)); | 208 ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON, |
| 209 ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_MOUSE))); |
| 209 view_->OnMouseReleased(ui::MouseEvent( | 210 view_->OnMouseReleased(ui::MouseEvent( |
| 210 ui::ET_MOUSE_RELEASED, center, center, ui::EventTimeForNow(), | 211 ui::ET_MOUSE_RELEASED, center, center, ui::EventTimeForNow(), |
| 211 ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON)); | 212 ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON, |
| 213 ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_MOUSE))); |
| 212 } | 214 } |
| 213 | 215 |
| 214 void NativeViewAccessibilityBase::OnWidgetDestroying(Widget* widget) { | 216 void NativeViewAccessibilityBase::OnWidgetDestroying(Widget* widget) { |
| 215 if (parent_widget_ == widget) { | 217 if (parent_widget_ == widget) { |
| 216 parent_widget_->RemoveObserver(this); | 218 parent_widget_->RemoveObserver(this); |
| 217 parent_widget_ = nullptr; | 219 parent_widget_ = nullptr; |
| 218 } | 220 } |
| 219 } | 221 } |
| 220 | 222 |
| 221 void NativeViewAccessibilityBase::SetParentWidget(Widget* parent_widget) { | 223 void NativeViewAccessibilityBase::SetParentWidget(Widget* parent_widget) { |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 child_widget_platform_node->GetDelegate()); | 258 child_widget_platform_node->GetDelegate()); |
| 257 if (child_widget_view_accessibility->parent_widget() != widget) | 259 if (child_widget_view_accessibility->parent_widget() != widget) |
| 258 child_widget_view_accessibility->SetParentWidget(widget); | 260 child_widget_view_accessibility->SetParentWidget(widget); |
| 259 } | 261 } |
| 260 | 262 |
| 261 result_child_widgets->push_back(child_widget); | 263 result_child_widgets->push_back(child_widget); |
| 262 } | 264 } |
| 263 } | 265 } |
| 264 | 266 |
| 265 } // namespace views | 267 } // namespace views |
| OLD | NEW |