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

Side by Side Diff: ui/views/controls/menu/menu_model_adapter.h

Issue 12789010: [win] Change app launcher profile indicator to be a menu. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Feedback Created 7 years, 9 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 7
8 #include <map> 8 #include <map>
9 9
10 #include "ui/views/controls/menu/menu_delegate.h" 10 #include "ui/views/controls/menu/menu_delegate.h"
(...skipping 21 matching lines...) Expand all
32 // Convenience for creating and populating a menu. The caller owns the 32 // Convenience for creating and populating a menu. The caller owns the
33 // returned MenuItemView. 33 // returned MenuItemView.
34 MenuItemView* CreateMenu(); 34 MenuItemView* CreateMenu();
35 35
36 void set_triggerable_event_flags(int triggerable_event_flags) { 36 void set_triggerable_event_flags(int triggerable_event_flags) {
37 triggerable_event_flags_ = triggerable_event_flags; 37 triggerable_event_flags_ = triggerable_event_flags;
38 } 38 }
39 int triggerable_event_flags() const { return triggerable_event_flags_; } 39 int triggerable_event_flags() const { return triggerable_event_flags_; }
40 40
41 protected: 41 protected:
42 // Subclasses override this to allow custom items to be added to the menu.
43 // The caller takes ownership of the returned MenuItemView.
44 virtual MenuItemView* CreateCustomItem(MenuItemView* parent, int id);
45
42 // views::MenuDelegate implementation. 46 // views::MenuDelegate implementation.
43 virtual void ExecuteCommand(int id) OVERRIDE; 47 virtual void ExecuteCommand(int id) OVERRIDE;
44 virtual void ExecuteCommand(int id, int mouse_event_flags) OVERRIDE; 48 virtual void ExecuteCommand(int id, int mouse_event_flags) OVERRIDE;
45 virtual bool IsTriggerableEvent(MenuItemView* source, 49 virtual bool IsTriggerableEvent(MenuItemView* source,
46 const ui::Event& e) OVERRIDE; 50 const ui::Event& e) OVERRIDE;
47 virtual bool GetAccelerator(int id, 51 virtual bool GetAccelerator(int id,
48 ui::Accelerator* accelerator) OVERRIDE; 52 ui::Accelerator* accelerator) OVERRIDE;
49 virtual string16 GetLabel(int id) const OVERRIDE; 53 virtual string16 GetLabel(int id) const OVERRIDE;
50 virtual const gfx::Font* GetLabelFont(int id) const OVERRIDE; 54 virtual const gfx::Font* GetLabelFont(int id) const OVERRIDE;
51 virtual bool IsCommandEnabled(int id) const OVERRIDE; 55 virtual bool IsCommandEnabled(int id) const OVERRIDE;
(...skipping 16 matching lines...) Expand all
68 72
69 // Map MenuItems to MenuModels. Used to implement WillShowMenu(). 73 // Map MenuItems to MenuModels. Used to implement WillShowMenu().
70 std::map<MenuItemView*, ui::MenuModel*> menu_map_; 74 std::map<MenuItemView*, ui::MenuModel*> menu_map_;
71 75
72 DISALLOW_COPY_AND_ASSIGN(MenuModelAdapter); 76 DISALLOW_COPY_AND_ASSIGN(MenuModelAdapter);
73 }; 77 };
74 78
75 } // namespace views 79 } // namespace views
76 80
77 #endif // UI_VIEWS_CONTROLS_MENU_MENU_MODEL_ADAPTER_H_ 81 #endif // UI_VIEWS_CONTROLS_MENU_MENU_MODEL_ADAPTER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698