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

Side by Side Diff: content/browser/accessibility/browser_accessibility_manager.cc

Issue 2956053005: Keep track of fixed positioning in accessibility tree.
Patch Set: Created 3 years, 5 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/browser/accessibility/browser_accessibility_manager.h" 5 #include "content/browser/accessibility/browser_accessibility_manager.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 TRACE_EVENT0("accessibility", 354 TRACE_EVENT0("accessibility",
355 "BrowserAccessibilityManager::OnAccessibilityEvents"); 355 "BrowserAccessibilityManager::OnAccessibilityEvents");
356 356
357 // Update the cached device scale factor. 357 // Update the cached device scale factor.
358 if (delegate_ && !use_custom_device_scale_factor_for_testing_) 358 if (delegate_ && !use_custom_device_scale_factor_for_testing_)
359 device_scale_factor_ = delegate_->AccessibilityGetDeviceScaleFactor(); 359 device_scale_factor_ = delegate_->AccessibilityGetDeviceScaleFactor();
360 360
361 // Process all changes to the accessibility tree first. 361 // Process all changes to the accessibility tree first.
362 for (uint32_t index = 0; index < details.size(); ++index) { 362 for (uint32_t index = 0; index < details.size(); ++index) {
363 const AXEventNotificationDetails& detail = details[index]; 363 const AXEventNotificationDetails& detail = details[index];
364 LOG(ERROR) << detail.update.ToString();
364 if (!tree_->Unserialize(detail.update)) { 365 if (!tree_->Unserialize(detail.update)) {
365 if (delegate_) { 366 if (delegate_) {
366 LOG(ERROR) << tree_->error(); 367 LOG(ERROR) << tree_->error();
367 delegate_->AccessibilityFatalError(); 368 delegate_->AccessibilityFatalError();
368 } else { 369 } else {
369 CHECK(false) << tree_->error(); 370 CHECK(false) << tree_->error();
370 } 371 }
371 return; 372 return;
372 } 373 }
373 } 374 }
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
459 NotifyAccessibilityEvent( 460 NotifyAccessibilityEvent(
460 BrowserAccessibilityEvent::FromBlink, 461 BrowserAccessibilityEvent::FromBlink,
461 event_type, 462 event_type,
462 event_target); 463 event_target);
463 } 464 }
464 } 465 }
465 } 466 }
466 467
467 void BrowserAccessibilityManager::OnLocationChanges( 468 void BrowserAccessibilityManager::OnLocationChanges(
468 const std::vector<AccessibilityHostMsg_LocationChangeParams>& params) { 469 const std::vector<AccessibilityHostMsg_LocationChangeParams>& params) {
470 LOG(ERROR) << "OnLocationChanges";
469 for (size_t i = 0; i < params.size(); ++i) { 471 for (size_t i = 0; i < params.size(); ++i) {
470 BrowserAccessibility* obj = GetFromID(params[i].id); 472 BrowserAccessibility* obj = GetFromID(params[i].id);
471 if (!obj) 473 if (!obj)
472 continue; 474 continue;
473 ui::AXNode* node = obj->node(); 475 ui::AXNode* node = obj->node();
474 node->SetLocation(params[i].new_location.offset_container_id, 476 node->SetLocation(params[i].new_location.offset_container_id,
475 params[i].new_location.bounds, 477 params[i].new_location.bounds,
476 params[i].new_location.transform.get()); 478 params[i].new_location.transform.get(),
479 params[i].new_location.is_fixed_positioned);
480 LOG(ERROR) << "Location update: " << node->data().ToString();
477 } 481 }
478 SendLocationChangeEvents(params); 482 SendLocationChangeEvents(params);
479 } 483 }
480 484
481 void BrowserAccessibilityManager::SendLocationChangeEvents( 485 void BrowserAccessibilityManager::SendLocationChangeEvents(
482 const std::vector<AccessibilityHostMsg_LocationChangeParams>& params) { 486 const std::vector<AccessibilityHostMsg_LocationChangeParams>& params) {
483 for (size_t i = 0; i < params.size(); ++i) { 487 for (size_t i = 0; i < params.size(); ++i) {
484 BrowserAccessibility* obj = GetFromID(params[i].id); 488 BrowserAccessibility* obj = GetFromID(params[i].id);
485 if (obj) 489 if (obj)
486 obj->OnLocationChanged(); 490 obj->OnLocationChanged();
(...skipping 825 matching lines...) Expand 10 before | Expand all | Expand 10 after
1312 hit_test_result = parent; 1316 hit_test_result = parent;
1313 parent = parent->PlatformGetParent(); 1317 parent = parent->PlatformGetParent();
1314 } 1318 }
1315 1319
1316 last_hover_ax_tree_id_ = hit_test_result->manager()->ax_tree_id(); 1320 last_hover_ax_tree_id_ = hit_test_result->manager()->ax_tree_id();
1317 last_hover_node_id_ = hit_test_result->GetId(); 1321 last_hover_node_id_ = hit_test_result->GetId();
1318 last_hover_bounds_ = hit_test_result->GetScreenBoundsRect(); 1322 last_hover_bounds_ = hit_test_result->GetScreenBoundsRect();
1319 } 1323 }
1320 1324
1321 } // namespace content 1325 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698