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

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

Issue 2518183002: Moved action verbs out of Blink. (Closed)
Patch Set: Added missing braces. Created 4 years 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/strings/ui_strings.grd ('k') | ui/views/controls/button/checkbox.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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/button.h" 5 #include "ui/views/controls/button/button.h"
6 6
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "ui/accessibility/ax_node_data.h" 8 #include "ui/accessibility/ax_node_data.h"
9 9
10 namespace views { 10 namespace views {
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 if (tooltip_text_.empty()) 58 if (tooltip_text_.empty())
59 return false; 59 return false;
60 60
61 *tooltip = tooltip_text_; 61 *tooltip = tooltip_text_;
62 return true; 62 return true;
63 } 63 }
64 64
65 void Button::GetAccessibleNodeData(ui::AXNodeData* node_data) { 65 void Button::GetAccessibleNodeData(ui::AXNodeData* node_data) {
66 node_data->role = ui::AX_ROLE_BUTTON; 66 node_data->role = ui::AX_ROLE_BUTTON;
67 node_data->SetName(accessible_name_); 67 node_data->SetName(accessible_name_);
68 if (!enabled())
69 node_data->AddStateFlag(ui::AX_STATE_DISABLED);
68 } 70 }
69 71
70 //////////////////////////////////////////////////////////////////////////////// 72 ////////////////////////////////////////////////////////////////////////////////
71 // Button, protected: 73 // Button, protected:
72 74
73 Button::Button(ButtonListener* listener) 75 Button::Button(ButtonListener* listener)
74 : listener_(listener), 76 : listener_(listener),
75 tag_(-1) { 77 tag_(-1) {
76 SetFocusBehavior(FocusBehavior::ACCESSIBLE_ONLY); 78 SetFocusBehavior(FocusBehavior::ACCESSIBLE_ONLY);
77 } 79 }
78 80
79 void Button::NotifyClick(const ui::Event& event) { 81 void Button::NotifyClick(const ui::Event& event) {
80 // We can be called when there is no listener, in cases like double clicks on 82 // We can be called when there is no listener, in cases like double clicks on
81 // menu buttons etc. 83 // menu buttons etc.
82 if (listener_) 84 if (listener_)
83 listener_->ButtonPressed(this, event); 85 listener_->ButtonPressed(this, event);
84 } 86 }
85 87
86 void Button::OnClickCanceled(const ui::Event& event) {} 88 void Button::OnClickCanceled(const ui::Event& event) {}
87 89
88 } // namespace views 90 } // namespace views
OLDNEW
« no previous file with comments | « ui/strings/ui_strings.grd ('k') | ui/views/controls/button/checkbox.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698