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

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

Issue 11419227: touch: Fix ctrl+taps for buttons on bookmark bar and toolbar. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 | Annotate | Revision Log
« no previous file with comments | « ui/views/controls/button/button.h ('k') | no next file » | 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 state->role = ui::AccessibilityTypes::ROLE_PUSHBUTTON; 43 state->role = ui::AccessibilityTypes::ROLE_PUSHBUTTON;
44 state->name = accessible_name_; 44 state->name = accessible_name_;
45 state->keyboard_shortcut = accessible_shortcut_; 45 state->keyboard_shortcut = accessible_shortcut_;
46 } 46 }
47 47
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) {
55 set_accessibility_focusable(true); 54 set_accessibility_focusable(true);
56 } 55 }
57 56
58 void Button::NotifyClick(const ui::Event& event) { 57 void Button::NotifyClick(const ui::Event& event) {
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 58 // We can be called when there is no listener, in cases like double clicks on
61 // menu buttons etc. 59 // menu buttons etc.
62 if (listener_) 60 if (listener_)
63 listener_->ButtonPressed(this, event); 61 listener_->ButtonPressed(this, event);
64 // NOTE: don't attempt to reset mouse_event_flags_ as the listener may have
65 // deleted us.
66 } 62 }
67 63
68 } // namespace views 64 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/button/button.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698