| 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 <algorithm> | 10 #include <algorithm> |
| (...skipping 4374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4385 if (language.empty()) { | 4385 if (language.empty()) { |
| 4386 attributes.push_back(L"language:en-US"); | 4386 attributes.push_back(L"language:en-US"); |
| 4387 } else { | 4387 } else { |
| 4388 SanitizeStringAttributeForIA2(language, &language); | 4388 SanitizeStringAttributeForIA2(language, &language); |
| 4389 attributes.push_back(L"language:" + language); | 4389 attributes.push_back(L"language:" + language); |
| 4390 } | 4390 } |
| 4391 | 4391 |
| 4392 // TODO(nektar): Add Blink support for the following attributes. | 4392 // TODO(nektar): Add Blink support for the following attributes. |
| 4393 // Currently set to their default values as dictated by the IA2 Spec. | 4393 // Currently set to their default values as dictated by the IA2 Spec. |
| 4394 attributes.push_back(L"text-line-through-mode:continuous"); | 4394 attributes.push_back(L"text-line-through-mode:continuous"); |
| 4395 attributes.push_back(L"text-line-through-style:none"); | 4395 if (text_style & ui::AX_TEXT_STYLE_LINE_THROUGH) { |
| 4396 // TODO(nektar): Figure out a more specific value. |
| 4397 attributes.push_back(L"text-line-through-style:solid"); |
| 4398 } else { |
| 4399 attributes.push_back(L"text-line-through-style:none"); |
| 4400 } |
| 4396 // Default value must be the empty string. | 4401 // Default value must be the empty string. |
| 4397 attributes.push_back(L"text-line-through-text:"); | 4402 attributes.push_back(L"text-line-through-text:"); |
| 4398 attributes.push_back(L"text-line-through-type:none"); | 4403 if (text_style & ui::AX_TEXT_STYLE_LINE_THROUGH) { |
| 4404 // TODO(nektar): Figure out a more specific value. |
| 4405 attributes.push_back(L"text-line-through-type:single"); |
| 4406 } else { |
| 4407 attributes.push_back(L"text-line-through-type:none"); |
| 4408 } |
| 4399 attributes.push_back(L"text-line-through-width:auto"); | 4409 attributes.push_back(L"text-line-through-width:auto"); |
| 4400 attributes.push_back(L"text-outline:false"); | 4410 attributes.push_back(L"text-outline:false"); |
| 4401 attributes.push_back(L"text-position:baseline"); | 4411 attributes.push_back(L"text-position:baseline"); |
| 4402 attributes.push_back(L"text-shadow:none"); | 4412 attributes.push_back(L"text-shadow:none"); |
| 4403 attributes.push_back(L"text-underline-mode:continuous"); | 4413 attributes.push_back(L"text-underline-mode:continuous"); |
| 4404 attributes.push_back(L"text-underline-style:none"); | 4414 if (text_style & ui::AX_TEXT_STYLE_UNDERLINE) { |
| 4405 attributes.push_back(L"text-underline-type:none"); | 4415 // TODO(nektar): Figure out a more specific value. |
| 4416 attributes.push_back(L"text-underline-style:solid"); |
| 4417 attributes.push_back(L"text-underline-type:single"); |
| 4418 } else { |
| 4419 attributes.push_back(L"text-underline-style:none"); |
| 4420 attributes.push_back(L"text-underline-type:none"); |
| 4421 } |
| 4406 attributes.push_back(L"text-underline-width:auto"); | 4422 attributes.push_back(L"text-underline-width:auto"); |
| 4407 | 4423 |
| 4408 auto text_direction = static_cast<ui::AXTextDirection>( | 4424 auto text_direction = static_cast<ui::AXTextDirection>( |
| 4409 GetIntAttribute(ui::AX_ATTR_TEXT_DIRECTION)); | 4425 GetIntAttribute(ui::AX_ATTR_TEXT_DIRECTION)); |
| 4410 switch (text_direction) { | 4426 switch (text_direction) { |
| 4411 case ui::AX_TEXT_DIRECTION_NONE: | 4427 case ui::AX_TEXT_DIRECTION_NONE: |
| 4412 case ui::AX_TEXT_DIRECTION_LTR: | 4428 case ui::AX_TEXT_DIRECTION_LTR: |
| 4413 attributes.push_back(L"writing-mode:lr"); | 4429 attributes.push_back(L"writing-mode:lr"); |
| 4414 break; | 4430 break; |
| 4415 case ui::AX_TEXT_DIRECTION_RTL: | 4431 case ui::AX_TEXT_DIRECTION_RTL: |
| (...skipping 1370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5786 return static_cast<BrowserAccessibilityWin*>(obj); | 5802 return static_cast<BrowserAccessibilityWin*>(obj); |
| 5787 } | 5803 } |
| 5788 | 5804 |
| 5789 const BrowserAccessibilityWin* | 5805 const BrowserAccessibilityWin* |
| 5790 ToBrowserAccessibilityWin(const BrowserAccessibility* obj) { | 5806 ToBrowserAccessibilityWin(const BrowserAccessibility* obj) { |
| 5791 DCHECK(!obj || obj->IsNative()); | 5807 DCHECK(!obj || obj->IsNative()); |
| 5792 return static_cast<const BrowserAccessibilityWin*>(obj); | 5808 return static_cast<const BrowserAccessibilityWin*>(obj); |
| 5793 } | 5809 } |
| 5794 | 5810 |
| 5795 } // namespace content | 5811 } // namespace content |
| OLD | NEW |