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

Side by Side Diff: chrome/browser/extensions/api/automation_internal/automation_internal_api.cc

Issue 2762373002: Fix computation of Automation API location offsets in WebViews. (Closed)
Patch Set: Rebase Created 3 years, 9 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 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 "chrome/browser/extensions/api/automation_internal/automation_internal_ api.h" 5 #include "chrome/browser/extensions/api/automation_internal/automation_internal_ api.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <vector> 10 #include <vector>
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 // content::WebContentsObserver overrides. 169 // content::WebContentsObserver overrides.
170 void AccessibilityEventReceived( 170 void AccessibilityEventReceived(
171 const std::vector<content::AXEventNotificationDetails>& details) 171 const std::vector<content::AXEventNotificationDetails>& details)
172 override { 172 override {
173 for (const auto& event : details) { 173 for (const auto& event : details) {
174 ExtensionMsg_AccessibilityEventParams params; 174 ExtensionMsg_AccessibilityEventParams params;
175 params.tree_id = event.ax_tree_id; 175 params.tree_id = event.ax_tree_id;
176 params.id = event.id; 176 params.id = event.id;
177 params.event_type = event.event_type; 177 params.event_type = event.event_type;
178 params.update = event.update; 178 params.update = event.update;
179 params.location_offset =
180 web_contents()->GetContainerBounds().OffsetFromOrigin();
181 params.event_from = event.event_from; 179 params.event_from = event.event_from;
182 180
183 AutomationEventRouter* router = AutomationEventRouter::GetInstance(); 181 AutomationEventRouter* router = AutomationEventRouter::GetInstance();
184 router->DispatchAccessibilityEvent(params); 182 router->DispatchAccessibilityEvent(params);
185 } 183 }
186 } 184 }
187 185
188 void AccessibilityLocationChangesReceived( 186 void AccessibilityLocationChangesReceived(
189 const std::vector<content::AXLocationChangeNotificationDetails>& details) 187 const std::vector<content::AXLocationChangeNotificationDetails>& details)
190 override { 188 override {
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
509 int result_acc_obj_id) { 507 int result_acc_obj_id) {
510 if (!error.empty()) { 508 if (!error.empty()) {
511 Respond(Error(error)); 509 Respond(Error(error));
512 return; 510 return;
513 } 511 }
514 512
515 Respond(OneArgument(base::MakeUnique<base::Value>(result_acc_obj_id))); 513 Respond(OneArgument(base::MakeUnique<base::Value>(result_acc_obj_id)));
516 } 514 }
517 515
518 } // namespace extensions 516 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698