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

Side by Side Diff: ui/views/controls/menu/menu_model_adapter.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 | « ui/views/controls/menu/menu_delegate.cc ('k') | ui/views/controls/menu/menu_model_adapter.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_MENU_MENU_MODEL_ADAPTER_H_ 5 #ifndef UI_VIEWS_CONTROLS_MENU_MENU_MODEL_ADAPTER_H_
6 #define UI_VIEWS_CONTROLS_MENU_MENU_MODEL_ADAPTER_H_ 6 #define UI_VIEWS_CONTROLS_MENU_MENU_MODEL_ADAPTER_H_
7 #pragma once 7 #pragma once
8 8
9 #include <map> 9 #include <map>
10 10
(...skipping 26 matching lines...) Expand all
37 void set_triggerable_event_flags(int triggerable_event_flags) { 37 void set_triggerable_event_flags(int triggerable_event_flags) {
38 triggerable_event_flags_ = triggerable_event_flags; 38 triggerable_event_flags_ = triggerable_event_flags;
39 } 39 }
40 int triggerable_event_flags() const { return triggerable_event_flags_; } 40 int triggerable_event_flags() const { return triggerable_event_flags_; }
41 41
42 protected: 42 protected:
43 // views::MenuDelegate implementation. 43 // views::MenuDelegate implementation.
44 virtual void ExecuteCommand(int id) OVERRIDE; 44 virtual void ExecuteCommand(int id) OVERRIDE;
45 virtual void ExecuteCommand(int id, int mouse_event_flags) OVERRIDE; 45 virtual void ExecuteCommand(int id, int mouse_event_flags) OVERRIDE;
46 virtual bool IsTriggerableEvent(MenuItemView* source, 46 virtual bool IsTriggerableEvent(MenuItemView* source,
47 const MouseEvent& e) OVERRIDE; 47 const Event& e) OVERRIDE;
48 virtual bool GetAccelerator(int id, 48 virtual bool GetAccelerator(int id,
49 ui::Accelerator* accelerator) OVERRIDE; 49 ui::Accelerator* accelerator) OVERRIDE;
50 virtual string16 GetLabel(int id) const OVERRIDE; 50 virtual string16 GetLabel(int id) const OVERRIDE;
51 virtual const gfx::Font& GetLabelFont(int id) const OVERRIDE; 51 virtual const gfx::Font& GetLabelFont(int id) const OVERRIDE;
52 virtual bool IsCommandEnabled(int id) const OVERRIDE; 52 virtual bool IsCommandEnabled(int id) const OVERRIDE;
53 virtual bool IsItemChecked(int id) const OVERRIDE; 53 virtual bool IsItemChecked(int id) const OVERRIDE;
54 virtual void SelectionChanged(MenuItemView* menu) OVERRIDE; 54 virtual void SelectionChanged(MenuItemView* menu) OVERRIDE;
55 virtual void WillShowMenu(MenuItemView* menu) OVERRIDE; 55 virtual void WillShowMenu(MenuItemView* menu) OVERRIDE;
56 virtual void WillHideMenu(MenuItemView* menu) OVERRIDE; 56 virtual void WillHideMenu(MenuItemView* menu) OVERRIDE;
57 57
(...skipping 13 matching lines...) Expand all
71 71
72 // Map MenuItems to MenuModels. Used to implement WillShowMenu(). 72 // Map MenuItems to MenuModels. Used to implement WillShowMenu().
73 std::map<MenuItemView*, ui::MenuModel*> menu_map_; 73 std::map<MenuItemView*, ui::MenuModel*> menu_map_;
74 74
75 DISALLOW_COPY_AND_ASSIGN(MenuModelAdapter); 75 DISALLOW_COPY_AND_ASSIGN(MenuModelAdapter);
76 }; 76 };
77 77
78 } // namespace views 78 } // namespace views
79 79
80 #endif // UI_VIEWS_CONTROLS_MENU_MENU_MODEL_ADAPTER_H_ 80 #endif // UI_VIEWS_CONTROLS_MENU_MENU_MODEL_ADAPTER_H_
OLDNEW
« no previous file with comments | « ui/views/controls/menu/menu_delegate.cc ('k') | ui/views/controls/menu/menu_model_adapter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698