| OLD | NEW |
| 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 "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| (...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 598 target->ia_role() == ROLE_SYSTEM_SCROLLBAR || | 598 target->ia_role() == ROLE_SYSTEM_SCROLLBAR || |
| 599 target->ia_role() == ROLE_SYSTEM_SLIDER) { | 599 target->ia_role() == ROLE_SYSTEM_SLIDER) { |
| 600 base::string16 value_text = target->GetValueText(); | 600 base::string16 value_text = target->GetValueText(); |
| 601 *value = SysAllocString(value_text.c_str()); | 601 *value = SysAllocString(value_text.c_str()); |
| 602 DCHECK(*value); | 602 DCHECK(*value); |
| 603 return S_OK; | 603 return S_OK; |
| 604 } | 604 } |
| 605 | 605 |
| 606 // Expose color well value. | 606 // Expose color well value. |
| 607 if (target->ia2_role() == IA2_ROLE_COLOR_CHOOSER) { | 607 if (target->ia2_role() == IA2_ROLE_COLOR_CHOOSER) { |
| 608 int r = target->GetIntAttribute( | 608 int color = target->GetIntAttribute(ui::AX_ATTR_COLOR_VALUE); |
| 609 ui::AX_ATTR_COLOR_VALUE_RED); | 609 int red = (color >> 16) & 0xFF; |
| 610 int g = target->GetIntAttribute( | 610 int green = (color >> 8) & 0xFF; |
| 611 ui::AX_ATTR_COLOR_VALUE_GREEN); | 611 int blue = color & 0xFF; |
| 612 int b = target->GetIntAttribute( | |
| 613 ui::AX_ATTR_COLOR_VALUE_BLUE); | |
| 614 base::string16 value_text; | 612 base::string16 value_text; |
| 615 value_text = base::IntToString16((r * 100) / 255) + L"% red " + | 613 value_text = base::IntToString16((red * 100) / 255) + L"% red " + |
| 616 base::IntToString16((g * 100) / 255) + L"% green " + | 614 base::IntToString16((green * 100) / 255) + L"% green " + |
| 617 base::IntToString16((b * 100) / 255) + L"% blue"; | 615 base::IntToString16((blue * 100) / 255) + L"% blue"; |
| 618 *value = SysAllocString(value_text.c_str()); | 616 *value = SysAllocString(value_text.c_str()); |
| 619 DCHECK(*value); | 617 DCHECK(*value); |
| 620 return S_OK; | 618 return S_OK; |
| 621 } | 619 } |
| 622 | 620 |
| 623 *value = SysAllocString(target->value().c_str()); | 621 *value = SysAllocString(target->value().c_str()); |
| 624 DCHECK(*value); | 622 DCHECK(*value); |
| 625 return S_OK; | 623 return S_OK; |
| 626 } | 624 } |
| 627 | 625 |
| (...skipping 3722 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4350 ia2_role = ia_role; | 4348 ia2_role = ia_role; |
| 4351 | 4349 |
| 4352 win_attributes_->ia_role = ia_role; | 4350 win_attributes_->ia_role = ia_role; |
| 4353 win_attributes_->ia_state = ia_state; | 4351 win_attributes_->ia_state = ia_state; |
| 4354 win_attributes_->role_name = role_name; | 4352 win_attributes_->role_name = role_name; |
| 4355 win_attributes_->ia2_role = ia2_role; | 4353 win_attributes_->ia2_role = ia2_role; |
| 4356 win_attributes_->ia2_state = ia2_state; | 4354 win_attributes_->ia2_state = ia2_state; |
| 4357 } | 4355 } |
| 4358 | 4356 |
| 4359 } // namespace content | 4357 } // namespace content |
| OLD | NEW |