| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/browser_accessibility_win.h" | 5 #include "chrome/browser/browser_accessibility_win.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "chrome/browser/browser_accessibility_manager_win.h" | 10 #include "chrome/browser/browser_accessibility_manager_win.h" |
| (...skipping 1088 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1099 if ((web_state >> WebAccessibility::STATE_OFFSCREEN) & 1) | 1099 if ((web_state >> WebAccessibility::STATE_OFFSCREEN) & 1) |
| 1100 state_ |= STATE_SYSTEM_OFFSCREEN; | 1100 state_ |= STATE_SYSTEM_OFFSCREEN; |
| 1101 if ((web_state >> WebAccessibility::STATE_PRESSED) & 1) | 1101 if ((web_state >> WebAccessibility::STATE_PRESSED) & 1) |
| 1102 state_ |= STATE_SYSTEM_PRESSED; | 1102 state_ |= STATE_SYSTEM_PRESSED; |
| 1103 if ((web_state >> WebAccessibility::STATE_PROTECTED) & 1) | 1103 if ((web_state >> WebAccessibility::STATE_PROTECTED) & 1) |
| 1104 state_ |= STATE_SYSTEM_PROTECTED; | 1104 state_ |= STATE_SYSTEM_PROTECTED; |
| 1105 if ((web_state >> WebAccessibility::STATE_READONLY) & 1) | 1105 if ((web_state >> WebAccessibility::STATE_READONLY) & 1) |
| 1106 state_ |= STATE_SYSTEM_READONLY; | 1106 state_ |= STATE_SYSTEM_READONLY; |
| 1107 if ((web_state >> WebAccessibility::STATE_TRAVERSED) & 1) | 1107 if ((web_state >> WebAccessibility::STATE_TRAVERSED) & 1) |
| 1108 state_ |= STATE_SYSTEM_TRAVERSED; | 1108 state_ |= STATE_SYSTEM_TRAVERSED; |
| 1109 if ((web_state >> WebAccessibility::STATE_BUSY) & 1) |
| 1110 state_ |= STATE_SYSTEM_BUSY; |
| 1109 if ((web_state >> WebAccessibility::STATE_UNAVAILABLE) & 1) | 1111 if ((web_state >> WebAccessibility::STATE_UNAVAILABLE) & 1) |
| 1110 state_ |= STATE_SYSTEM_UNAVAILABLE; | 1112 state_ |= STATE_SYSTEM_UNAVAILABLE; |
| 1111 | 1113 |
| 1112 role_ = 0; | 1114 role_ = 0; |
| 1113 ia2_role_ = 0; | 1115 ia2_role_ = 0; |
| 1114 switch (web_role) { | 1116 switch (web_role) { |
| 1115 case WebAccessibility::ROLE_ALERT: | 1117 case WebAccessibility::ROLE_ALERT: |
| 1116 case WebAccessibility::ROLE_ALERT_DIALOG: | 1118 case WebAccessibility::ROLE_ALERT_DIALOG: |
| 1117 role_ = ROLE_SYSTEM_ALERT; | 1119 role_ = ROLE_SYSTEM_ALERT; |
| 1118 break; | 1120 break; |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1356 } | 1358 } |
| 1357 | 1359 |
| 1358 // The role should always be set. | 1360 // The role should always be set. |
| 1359 DCHECK(!role_name_.empty() || role_); | 1361 DCHECK(!role_name_.empty() || role_); |
| 1360 | 1362 |
| 1361 // If we didn't explicitly set the IAccessible2 role, make it the same | 1363 // If we didn't explicitly set the IAccessible2 role, make it the same |
| 1362 // as the MSAA role. | 1364 // as the MSAA role. |
| 1363 if (!ia2_role_) | 1365 if (!ia2_role_) |
| 1364 ia2_role_ = role_; | 1366 ia2_role_ = role_; |
| 1365 } | 1367 } |
| OLD | NEW |