Chromium Code Reviews| 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 3329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3340 help.clear(); | 3340 help.clear(); |
| 3341 } | 3341 } |
| 3342 if (!description.empty() && name.empty() && !title_elem_id) { | 3342 if (!description.empty() && name.empty() && !title_elem_id) { |
| 3343 name = description; | 3343 name = description; |
| 3344 description.clear(); | 3344 description.clear(); |
| 3345 } | 3345 } |
| 3346 | 3346 |
| 3347 // If it's a text field, also consider the placeholder. | 3347 // If it's a text field, also consider the placeholder. |
| 3348 base::string16 placeholder; | 3348 base::string16 placeholder; |
| 3349 if (GetRole() == ui::AX_ROLE_TEXT_FIELD && | 3349 if (GetRole() == ui::AX_ROLE_TEXT_FIELD && |
| 3350 HasState(ui::AX_STATE_FOCUSABLE) && | 3350 HasState(ui::AX_STATE_FOCUSABLE) &&HasState(ui::AX_STATE_FOCUSABLE) |
|
David Tseng
2015/05/08 21:58:25
Unrelated?
| |
| 3351 GetHtmlAttribute("placeholder", &placeholder)) { | 3351 GetHtmlAttribute("placeholder", &placeholder)) { |
| 3352 if (name.empty() && !title_elem_id) { | 3352 if (name.empty() && !title_elem_id) { |
| 3353 name = placeholder; | 3353 name = placeholder; |
| 3354 } else if (description.empty()) { | 3354 } else if (description.empty()) { |
| 3355 description = placeholder; | 3355 description = placeholder; |
| 3356 } | 3356 } |
| 3357 } | 3357 } |
| 3358 | 3358 |
| 3359 // On Windows, the value of a document should be its url. | 3359 // On Windows, the value of a document should be its url. |
| 3360 if (GetRole() == ui::AX_ROLE_ROOT_WEB_AREA || | 3360 if (GetRole() == ui::AX_ROLE_ROOT_WEB_AREA || |
| (...skipping 989 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4350 ia2_role = ia_role; | 4350 ia2_role = ia_role; |
| 4351 | 4351 |
| 4352 win_attributes_->ia_role = ia_role; | 4352 win_attributes_->ia_role = ia_role; |
| 4353 win_attributes_->ia_state = ia_state; | 4353 win_attributes_->ia_state = ia_state; |
| 4354 win_attributes_->role_name = role_name; | 4354 win_attributes_->role_name = role_name; |
| 4355 win_attributes_->ia2_role = ia2_role; | 4355 win_attributes_->ia2_role = ia2_role; |
| 4356 win_attributes_->ia2_state = ia2_state; | 4356 win_attributes_->ia2_state = ia2_state; |
| 4357 } | 4357 } |
| 4358 | 4358 |
| 4359 } // namespace content | 4359 } // namespace content |
| OLD | NEW |