Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(201)

Side by Side Diff: ui/views/controls/button/image_button.cc

Issue 2707263011: Test aria-pressed=mixed on windows (Closed)
Patch Set: git cl try Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/views/controls/button/custom_button.cc ('k') | ui/views/controls/button/toggle_button.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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->AddState(ui::AX_STATE_PRESSED); 292 node_data->AddIntAttribute(ui::AX_ATTR_PRESSED_STATE,
293 ui::AX_BUTTON_STATE_TRUE);
293 } 294 }
294 } 295 }
295 296
296 } // namespace views 297 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/button/custom_button.cc ('k') | ui/views/controls/button/toggle_button.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698