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

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

Issue 6480001: Migrate Event API methods to Google Style. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 10 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
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "views/controls/button/button.h" 5 #include "views/controls/button/button.h"
6 #include "base/utf_string_conversions.h" 6 #include "base/utf_string_conversions.h"
7 7
8 namespace views { 8 namespace views {
9 9
10 //////////////////////////////////////////////////////////////////////////////// 10 ////////////////////////////////////////////////////////////////////////////////
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 // Button, protected: 45 // Button, protected:
46 46
47 Button::Button(ButtonListener* listener) 47 Button::Button(ButtonListener* listener)
48 : listener_(listener), 48 : listener_(listener),
49 tag_(-1), 49 tag_(-1),
50 mouse_event_flags_(0) { 50 mouse_event_flags_(0) {
51 set_accessibility_focusable(true); 51 set_accessibility_focusable(true);
52 } 52 }
53 53
54 void Button::NotifyClick(const views::Event& event) { 54 void Button::NotifyClick(const views::Event& event) {
55 mouse_event_flags_ = event.IsMouseEvent() ? event.GetFlags() : 0; 55 mouse_event_flags_ = event.IsMouseEvent() ? event.flags() : 0;
56 // We can be called when there is no listener, in cases like double clicks on 56 // We can be called when there is no listener, in cases like double clicks on
57 // menu buttons etc. 57 // menu buttons etc.
58 if (listener_) 58 if (listener_)
59 listener_->ButtonPressed(this, event); 59 listener_->ButtonPressed(this, event);
60 // NOTE: don't attempt to reset mouse_event_flags_ as the listener may have 60 // NOTE: don't attempt to reset mouse_event_flags_ as the listener may have
61 // deleted us. 61 // deleted us.
62 } 62 }
63 63
64 } // namespace views 64 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698