| 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 "ui/views/controls/button/image_button.h" | 5 #include "ui/views/controls/button/image_button.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "ui/accessibility/ax_node_data.h" | 10 #include "ui/accessibility/ax_node_data.h" |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 base::string16 name; | 282 base::string16 name; |
| 283 GetTooltipText(gfx::Point(), &name); | 283 GetTooltipText(gfx::Point(), &name); |
| 284 node_data->SetName(name); | 284 node_data->SetName(name); |
| 285 | 285 |
| 286 // Use the visual pressed image as a cue for making this control into an | 286 // Use the visual pressed image as a cue for making this control into an |
| 287 // accessible toggle button. | 287 // accessible toggle button. |
| 288 if ((toggled_ && !images_[ButtonState::STATE_NORMAL].isNull()) || | 288 if ((toggled_ && !images_[ButtonState::STATE_NORMAL].isNull()) || |
| 289 (!toggled_ && !alternate_images_[ButtonState::STATE_NORMAL].isNull())) { | 289 (!toggled_ && !alternate_images_[ButtonState::STATE_NORMAL].isNull())) { |
| 290 node_data->role = ui::AX_ROLE_TOGGLE_BUTTON; | 290 node_data->role = ui::AX_ROLE_TOGGLE_BUTTON; |
| 291 if (toggled_) | 291 if (toggled_) |
| 292 node_data->AddStateFlag(ui::AX_STATE_PRESSED); | 292 node_data->AddState(ui::AX_STATE_PRESSED); |
| 293 } | 293 } |
| 294 } | 294 } |
| 295 | 295 |
| 296 } // namespace views | 296 } // namespace views |
| OLD | NEW |