Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(155)

Side by Side Diff: ui/views/accessibility/native_view_accessibility.cc

Issue 1260453006: ui: events: Add a class to hold common touch and stylus properties (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address build problems, add accessor and unit tests. Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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.h" 5 #include "ui/views/accessibility/native_view_accessibility.h"
6 6
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "ui/accessibility/ax_view_state.h" 8 #include "ui/accessibility/ax_view_state.h"
9 #include "ui/events/event_utils.h" 9 #include "ui/events/event_utils.h"
10 #include "ui/views/controls/native/native_view_host.h" 10 #include "ui/views/controls/native/native_view_host.h"
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 return focused_view ? focused_view->GetNativeViewAccessible() : nullptr; 170 return focused_view ? focused_view->GetNativeViewAccessible() : nullptr;
171 } 171 }
172 172
173 gfx::AcceleratedWidget 173 gfx::AcceleratedWidget
174 NativeViewAccessibility::GetTargetForNativeAccessibilityEvent() { 174 NativeViewAccessibility::GetTargetForNativeAccessibilityEvent() {
175 return gfx::kNullAcceleratedWidget; 175 return gfx::kNullAcceleratedWidget;
176 } 176 }
177 177
178 void NativeViewAccessibility::DoDefaultAction() { 178 void NativeViewAccessibility::DoDefaultAction() {
179 gfx::Point center = view_->GetLocalBounds().CenterPoint(); 179 gfx::Point center = view_->GetLocalBounds().CenterPoint();
180 view_->OnMousePressed(ui::MouseEvent(ui::ET_MOUSE_PRESSED, 180 view_->OnMousePressed(ui::MouseEvent(
181 center, 181 ui::ET_MOUSE_PRESSED, center, center, ui::EventTimeForNow(),
182 center, 182 ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON,
183 ui::EventTimeForNow(), 183 ui::PointerEventDetails(ui::EventPointerType::POINTER_TYPE_MOUSE)));
184 ui::EF_LEFT_MOUSE_BUTTON, 184 view_->OnMouseReleased(ui::MouseEvent(
185 ui::EF_LEFT_MOUSE_BUTTON)); 185 ui::ET_MOUSE_RELEASED, center, center, ui::EventTimeForNow(),
186 view_->OnMouseReleased(ui::MouseEvent(ui::ET_MOUSE_RELEASED, 186 ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON,
187 center, 187 ui::PointerEventDetails(ui::EventPointerType::POINTER_TYPE_MOUSE)));
188 center,
189 ui::EventTimeForNow(),
190 ui::EF_LEFT_MOUSE_BUTTON,
191 ui::EF_LEFT_MOUSE_BUTTON));
192 } 188 }
193 189
194 bool NativeViewAccessibility::SetStringValue(const base::string16& new_value) { 190 bool NativeViewAccessibility::SetStringValue(const base::string16& new_value) {
195 // Return an error if the view can't set the value. 191 // Return an error if the view can't set the value.
196 ui::AXViewState state; 192 ui::AXViewState state;
197 view_->GetAccessibleState(&state); 193 view_->GetAccessibleState(&state);
198 if (state.set_value_callback.is_null()) 194 if (state.set_value_callback.is_null())
199 return false; 195 return false;
200 196
201 state.set_value_callback.Run(new_value); 197 state.set_value_callback.Run(new_value);
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 child_widget_platform_node->GetDelegate()); 241 child_widget_platform_node->GetDelegate());
246 if (child_widget_view_accessibility->parent_widget() != widget) 242 if (child_widget_view_accessibility->parent_widget() != widget)
247 child_widget_view_accessibility->SetParentWidget(widget); 243 child_widget_view_accessibility->SetParentWidget(widget);
248 } 244 }
249 245
250 result_child_widgets->push_back(child_widget); 246 result_child_widgets->push_back(child_widget);
251 } 247 }
252 } 248 }
253 249
254 } // namespace views 250 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698