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

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

Issue 10827271: Replace views::Event with ui::Event. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « ui/views/controls/button/button.h ('k') | ui/views/controls/button/button_dropdown.h » ('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/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
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
OLDNEW
« no previous file with comments | « ui/views/controls/button/button.h ('k') | ui/views/controls/button/button_dropdown.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698