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

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

Issue 2024053003: Revert of Uses the activedescendant_changed event received from Blink to fire the right focus event (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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_win.h" 5 #include "content/browser/accessibility/browser_accessibility_win.h"
6 6
7 #include <UIAutomationClient.h> 7 #include <UIAutomationClient.h>
8 #include <UIAutomationCoreApi.h> 8 #include <UIAutomationCoreApi.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 3586 matching lines...) Expand 10 before | Expand all | Expand 10 after
3597 // Fire an event if the name, description, help, or value changes. 3597 // Fire an event if the name, description, help, or value changes.
3598 if (name() != old_win_attributes_->name) 3598 if (name() != old_win_attributes_->name)
3599 FireNativeEvent(EVENT_OBJECT_NAMECHANGE); 3599 FireNativeEvent(EVENT_OBJECT_NAMECHANGE);
3600 if (description() != old_win_attributes_->description) 3600 if (description() != old_win_attributes_->description)
3601 FireNativeEvent(EVENT_OBJECT_DESCRIPTIONCHANGE); 3601 FireNativeEvent(EVENT_OBJECT_DESCRIPTIONCHANGE);
3602 if (value() != old_win_attributes_->value) 3602 if (value() != old_win_attributes_->value)
3603 FireNativeEvent(EVENT_OBJECT_VALUECHANGE); 3603 FireNativeEvent(EVENT_OBJECT_VALUECHANGE);
3604 if (ia_state() != old_win_attributes_->ia_state) 3604 if (ia_state() != old_win_attributes_->ia_state)
3605 FireNativeEvent(EVENT_OBJECT_STATECHANGE); 3605 FireNativeEvent(EVENT_OBJECT_STATECHANGE);
3606 3606
3607 // Normally focus events are handled elsewhere, however
3608 // focus for managed descendants is platform-specific.
3609 // Fire a focus event if the focused descendant in a multi-select
3610 // list box changes.
3611 if (GetRole() == ui::AX_ROLE_LIST_BOX_OPTION &&
3612 (ia_state() & STATE_SYSTEM_FOCUSABLE) &&
3613 (ia_state() & STATE_SYSTEM_SELECTABLE) &&
3614 (ia_state() & STATE_SYSTEM_FOCUSED) &&
3615 !(old_win_attributes_->ia_state & STATE_SYSTEM_FOCUSED)) {
3616 FireNativeEvent(EVENT_OBJECT_FOCUS);
3617 }
3618
3607 // Handle selection being added or removed. 3619 // Handle selection being added or removed.
3608 bool is_selected_now = (ia_state() & STATE_SYSTEM_SELECTED) != 0; 3620 bool is_selected_now = (ia_state() & STATE_SYSTEM_SELECTED) != 0;
3609 bool was_selected_before = 3621 bool was_selected_before =
3610 (old_win_attributes_->ia_state & STATE_SYSTEM_SELECTED) != 0; 3622 (old_win_attributes_->ia_state & STATE_SYSTEM_SELECTED) != 0;
3611 if (is_selected_now || was_selected_before) { 3623 if (is_selected_now || was_selected_before) {
3612 bool multiselect = false; 3624 bool multiselect = false;
3613 if (GetParent() && GetParent()->HasState(ui::AX_STATE_MULTISELECTABLE)) 3625 if (GetParent() && GetParent()->HasState(ui::AX_STATE_MULTISELECTABLE))
3614 multiselect = true; 3626 multiselect = true;
3615 3627
3616 if (multiselect) { 3628 if (multiselect) {
(...skipping 1469 matching lines...) Expand 10 before | Expand all | Expand 10 after
5086 return static_cast<BrowserAccessibilityWin*>(obj); 5098 return static_cast<BrowserAccessibilityWin*>(obj);
5087 } 5099 }
5088 5100
5089 const BrowserAccessibilityWin* 5101 const BrowserAccessibilityWin*
5090 ToBrowserAccessibilityWin(const BrowserAccessibility* obj) { 5102 ToBrowserAccessibilityWin(const BrowserAccessibility* obj) {
5091 DCHECK(!obj || obj->IsNative()); 5103 DCHECK(!obj || obj->IsNative());
5092 return static_cast<const BrowserAccessibilityWin*>(obj); 5104 return static_cast<const BrowserAccessibilityWin*>(obj);
5093 } 5105 }
5094 5106
5095 } // namespace content 5107 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698