| 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 #include "ui/views/accessibility/ax_view_obj_wrapper.h" | 5 #include "ui/views/accessibility/ax_view_obj_wrapper.h" |
| 6 | 6 |
| 7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
| 8 #include "ui/accessibility/ax_action_data.h" | 8 #include "ui/accessibility/ax_action_data.h" |
| 9 #include "ui/accessibility/ax_node_data.h" | 9 #include "ui/accessibility/ax_node_data.h" |
| 10 #include "ui/events/event_utils.h" | 10 #include "ui/events/event_utils.h" |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 | 61 |
| 62 int32_t AXViewObjWrapper::GetID() { | 62 int32_t AXViewObjWrapper::GetID() { |
| 63 return AXAuraObjCache::GetInstance()->GetID(view_); | 63 return AXAuraObjCache::GetInstance()->GetID(view_); |
| 64 } | 64 } |
| 65 | 65 |
| 66 void AXViewObjWrapper::DoDefault() { | 66 void AXViewObjWrapper::DoDefault() { |
| 67 gfx::Rect rect = view_->GetLocalBounds(); | 67 gfx::Rect rect = view_->GetLocalBounds(); |
| 68 gfx::Point center = rect.CenterPoint(); | 68 gfx::Point center = rect.CenterPoint(); |
| 69 view_->OnMousePressed(ui::MouseEvent( | 69 view_->OnMousePressed(ui::MouseEvent( |
| 70 ui::ET_MOUSE_PRESSED, center, center, ui::EventTimeForNow(), | 70 ui::ET_MOUSE_PRESSED, center, center, ui::EventTimeForNow(), |
| 71 ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON)); | 71 ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON, |
| 72 ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_MOUSE, |
| 73 ui::PointerEvent::kMousePointerId))); |
| 72 view_->OnMouseReleased(ui::MouseEvent( | 74 view_->OnMouseReleased(ui::MouseEvent( |
| 73 ui::ET_MOUSE_RELEASED, center, center, ui::EventTimeForNow(), | 75 ui::ET_MOUSE_RELEASED, center, center, ui::EventTimeForNow(), |
| 74 ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON)); | 76 ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON, |
| 77 ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_MOUSE, |
| 78 ui::PointerEvent::kMousePointerId))); |
| 75 } | 79 } |
| 76 | 80 |
| 77 void AXViewObjWrapper::Focus() { | 81 void AXViewObjWrapper::Focus() { |
| 78 view_->RequestFocus(); | 82 view_->RequestFocus(); |
| 79 } | 83 } |
| 80 | 84 |
| 81 void AXViewObjWrapper::MakeVisible() { | 85 void AXViewObjWrapper::MakeVisible() { |
| 82 view_->ScrollRectToVisible(view_->GetLocalBounds()); | 86 view_->ScrollRectToVisible(view_->GetLocalBounds()); |
| 83 } | 87 } |
| 84 | 88 |
| 85 void AXViewObjWrapper::SetSelection(int32_t start, int32_t end) { | 89 void AXViewObjWrapper::SetSelection(int32_t start, int32_t end) { |
| 86 // TODO(dtseng): Implement. | 90 // TODO(dtseng): Implement. |
| 87 } | 91 } |
| 88 | 92 |
| 89 void AXViewObjWrapper::ShowContextMenu() { | 93 void AXViewObjWrapper::ShowContextMenu() { |
| 90 view_->ShowContextMenu(view_->bounds().CenterPoint(), | 94 view_->ShowContextMenu(view_->bounds().CenterPoint(), |
| 91 ui::MENU_SOURCE_KEYBOARD); | 95 ui::MENU_SOURCE_KEYBOARD); |
| 92 } | 96 } |
| 93 | 97 |
| 94 bool AXViewObjWrapper::HandleAccessibleAction(const ui::AXActionData& action) { | 98 bool AXViewObjWrapper::HandleAccessibleAction(const ui::AXActionData& action) { |
| 95 return view_->HandleAccessibleAction(action); | 99 return view_->HandleAccessibleAction(action); |
| 96 } | 100 } |
| 97 | 101 |
| 98 } // namespace views | 102 } // namespace views |
| OLD | NEW |