| 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_node_data.h" | 8 #include "ui/accessibility/ax_node_data.h" |
| 9 #include "ui/accessibility/ax_view_state.h" | 9 #include "ui/accessibility/ax_view_state.h" |
| 10 #include "ui/events/event_utils.h" | 10 #include "ui/events/event_utils.h" |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 view_data.selection_end); | 70 view_data.selection_end); |
| 71 } | 71 } |
| 72 } | 72 } |
| 73 | 73 |
| 74 int32 AXViewObjWrapper::GetID() { | 74 int32 AXViewObjWrapper::GetID() { |
| 75 return AXAuraObjCache::GetInstance()->GetID(view_); | 75 return AXAuraObjCache::GetInstance()->GetID(view_); |
| 76 } | 76 } |
| 77 | 77 |
| 78 void AXViewObjWrapper::DoDefault() { | 78 void AXViewObjWrapper::DoDefault() { |
| 79 gfx::Rect rect = view_->GetLocalBounds(); | 79 gfx::Rect rect = view_->GetLocalBounds(); |
| 80 gfx::Point center = rect.CenterPoint(); | 80 gfx::PointF center(rect.CenterPoint()); |
| 81 view_->OnMousePressed(ui::MouseEvent( | 81 view_->OnMousePressed(ui::MouseEvent( |
| 82 ui::ET_MOUSE_PRESSED, center, center, ui::EventTimeForNow(), | 82 ui::ET_MOUSE_PRESSED, center, center, ui::EventTimeForNow(), |
| 83 ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON)); | 83 ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON)); |
| 84 view_->OnMouseReleased(ui::MouseEvent( | 84 view_->OnMouseReleased(ui::MouseEvent( |
| 85 ui::ET_MOUSE_RELEASED, center, center, ui::EventTimeForNow(), | 85 ui::ET_MOUSE_RELEASED, center, center, ui::EventTimeForNow(), |
| 86 ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON)); | 86 ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON)); |
| 87 } | 87 } |
| 88 | 88 |
| 89 void AXViewObjWrapper::Focus() { | 89 void AXViewObjWrapper::Focus() { |
| 90 view_->RequestFocus(); | 90 view_->RequestFocus(); |
| 91 } | 91 } |
| 92 | 92 |
| 93 void AXViewObjWrapper::MakeVisible() { | 93 void AXViewObjWrapper::MakeVisible() { |
| 94 // TODO(dtseng): Implement. | 94 // TODO(dtseng): Implement. |
| 95 } | 95 } |
| 96 | 96 |
| 97 void AXViewObjWrapper::SetSelection(int32 start, int32 end) { | 97 void AXViewObjWrapper::SetSelection(int32 start, int32 end) { |
| 98 // TODO(dtseng): Implement. | 98 // TODO(dtseng): Implement. |
| 99 } | 99 } |
| 100 | 100 |
| 101 void AXViewObjWrapper::ShowContextMenu() { | 101 void AXViewObjWrapper::ShowContextMenu() { |
| 102 view_->ShowContextMenu(view_->bounds().CenterPoint(), | 102 view_->ShowContextMenu(view_->bounds().CenterPoint(), |
| 103 ui::MENU_SOURCE_KEYBOARD); | 103 ui::MENU_SOURCE_KEYBOARD); |
| 104 } | 104 } |
| 105 | 105 |
| 106 } // namespace views | 106 } // namespace views |
| OLD | NEW |