OLD | NEW |
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/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
8 #include "ui/base/accessibility/accessible_view_state.h" | 8 #include "ui/base/accessibility/accessible_view_state.h" |
9 | 9 |
10 namespace views { | 10 namespace views { |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 //////////////////////////////////////////////////////////////////////////////// | 48 //////////////////////////////////////////////////////////////////////////////// |
49 // Button, protected: | 49 // Button, protected: |
50 | 50 |
51 Button::Button(ButtonListener* listener) | 51 Button::Button(ButtonListener* listener) |
52 : listener_(listener), | 52 : listener_(listener), |
53 tag_(-1), | 53 tag_(-1), |
54 mouse_event_flags_(0) { | 54 mouse_event_flags_(0) { |
55 set_accessibility_focusable(true); | 55 set_accessibility_focusable(true); |
56 } | 56 } |
57 | 57 |
58 void Button::NotifyClick(const views::Event& event) { | 58 void Button::NotifyClick(const ui::Event& event) { |
59 mouse_event_flags_ = event.IsMouseEvent() ? event.flags() : 0; | 59 mouse_event_flags_ = event.IsMouseEvent() ? event.flags() : 0; |
60 // We can be called when there is no listener, in cases like double clicks on | 60 // We can be called when there is no listener, in cases like double clicks on |
61 // menu buttons etc. | 61 // menu buttons etc. |
62 if (listener_) | 62 if (listener_) |
63 listener_->ButtonPressed(this, event); | 63 listener_->ButtonPressed(this, event); |
64 // NOTE: don't attempt to reset mouse_event_flags_ as the listener may have | 64 // NOTE: don't attempt to reset mouse_event_flags_ as the listener may have |
65 // deleted us. | 65 // deleted us. |
66 } | 66 } |
67 | 67 |
68 } // namespace views | 68 } // namespace views |
OLD | NEW |