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

Side by Side Diff: ui/views/controls/button/button_dropdown.h

Issue 10546104: Make IsTriggerableEvent take Event objects and use it to verify whether tap events should trigger. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Pass Event to ShouldEnterPushedState. Created 8 years, 6 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 | « chrome/browser/ui/views/wrench_menu.cc ('k') | ui/views/controls/button/button_dropdown.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 #ifndef UI_VIEWS_CONTROLS_BUTTON_BUTTON_DROPDOWN_H_ 5 #ifndef UI_VIEWS_CONTROLS_BUTTON_BUTTON_DROPDOWN_H_
6 #define UI_VIEWS_CONTROLS_BUTTON_BUTTON_DROPDOWN_H_ 6 #define UI_VIEWS_CONTROLS_BUTTON_BUTTON_DROPDOWN_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/memory/weak_ptr.h" 9 #include "base/memory/weak_ptr.h"
10 #include "ui/views/controls/button/image_button.h" 10 #include "ui/views/controls/button/image_button.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 // Using the member function ShowDropDownMenu for the actual display. 43 // Using the member function ShowDropDownMenu for the actual display.
44 virtual void ShowContextMenu(const gfx::Point& p, 44 virtual void ShowContextMenu(const gfx::Point& p,
45 bool is_mouse_gesture) OVERRIDE; 45 bool is_mouse_gesture) OVERRIDE;
46 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; 46 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE;
47 47
48 protected: 48 protected:
49 // Overridden from CustomButton. Returns true if the button should become 49 // Overridden from CustomButton. Returns true if the button should become
50 // pressed when a user holds the mouse down over the button. For this 50 // pressed when a user holds the mouse down over the button. For this
51 // implementation, both left and right mouse buttons can trigger a change 51 // implementation, both left and right mouse buttons can trigger a change
52 // to the PUSHED state. 52 // to the PUSHED state.
53 virtual bool ShouldEnterPushedState(const MouseEvent& event) OVERRIDE; 53 virtual bool ShouldEnterPushedState(const Event& event) OVERRIDE;
54 54
55 private: 55 private:
56 // Internal function to show the dropdown menu 56 // Internal function to show the dropdown menu
57 void ShowDropDownMenu(gfx::NativeView window); 57 void ShowDropDownMenu(gfx::NativeView window);
58 58
59 // The model that populates the attached menu. 59 // The model that populates the attached menu.
60 ui::MenuModel* model_; 60 ui::MenuModel* model_;
61 61
62 // Y position of mouse when left mouse button is pressed 62 // Y position of mouse when left mouse button is pressed
63 int y_position_on_lbuttondown_; 63 int y_position_on_lbuttondown_;
64 64
65 // A factory for tasks that show the dropdown context menu for the button. 65 // A factory for tasks that show the dropdown context menu for the button.
66 base::WeakPtrFactory<ButtonDropDown> show_menu_factory_; 66 base::WeakPtrFactory<ButtonDropDown> show_menu_factory_;
67 67
68 DISALLOW_COPY_AND_ASSIGN(ButtonDropDown); 68 DISALLOW_COPY_AND_ASSIGN(ButtonDropDown);
69 }; 69 };
70 70
71 } // namespace views 71 } // namespace views
72 72
73 #endif // UI_VIEWS_CONTROLS_BUTTON_BUTTON_DROPDOWN_H_ 73 #endif // UI_VIEWS_CONTROLS_BUTTON_BUTTON_DROPDOWN_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/wrench_menu.cc ('k') | ui/views/controls/button/button_dropdown.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698