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

Unified Diff: ui/views/controls/button/image_button.cc

Issue 2477463003: Replace ui::AXViewState with AXNodeData and AXActionData (Closed)
Patch Set: Fix test Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/controls/button/image_button.h ('k') | ui/views/controls/button/label_button_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/button/image_button.cc
diff --git a/ui/views/controls/button/image_button.cc b/ui/views/controls/button/image_button.cc
index d9426bea1f3daecc2faa985e6e4f9741a79645be..7049bc3a2768d231cf2f80104d4ea7fe8fffc67e 100644
--- a/ui/views/controls/button/image_button.cc
+++ b/ui/views/controls/button/image_button.cc
@@ -7,7 +7,7 @@
#include <utility>
#include "base/strings/utf_string_conversions.h"
-#include "ui/accessibility/ax_view_state.h"
+#include "ui/accessibility/ax_node_data.h"
#include "ui/gfx/animation/throb_animation.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/image/image_skia_operations.h"
@@ -269,17 +269,19 @@ bool ToggleImageButton::GetTooltipText(const gfx::Point& p,
return true;
}
-void ToggleImageButton::GetAccessibleState(ui::AXViewState* state) {
- ImageButton::GetAccessibleState(state);
- GetTooltipText(gfx::Point(), &state->name);
+void ToggleImageButton::GetAccessibleNodeData(ui::AXNodeData* node_data) {
+ ImageButton::GetAccessibleNodeData(node_data);
+ base::string16 name;
+ GetTooltipText(gfx::Point(), &name);
+ node_data->SetName(name);
// Use the visual pressed image as a cue for making this control into an
// accessible toggle button.
if ((toggled_ && !images_[ButtonState::STATE_NORMAL].isNull()) ||
(!toggled_ && !alternate_images_[ButtonState::STATE_NORMAL].isNull())) {
- state->role = ui::AX_ROLE_TOGGLE_BUTTON;
+ node_data->role = ui::AX_ROLE_TOGGLE_BUTTON;
if (toggled_)
- state->AddStateFlag(ui::AX_STATE_PRESSED);
+ node_data->AddStateFlag(ui::AX_STATE_PRESSED);
}
}
« no previous file with comments | « ui/views/controls/button/image_button.h ('k') | ui/views/controls/button/label_button_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698