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

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

Issue 7044016: Replace ButtonDropDown menu implementation (Menu2) with MenuItemView. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: One last little style fix. Created 9 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 | « views/controls/menu/menu_item_view.cc ('k') | 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 VIEWS_CONTROLS_MENU_MENU_MODEL_ADAPTER_H_ 5 #ifndef VIEWS_CONTROLS_MENU_MENU_MODEL_ADAPTER_H_
6 #define VIEWS_CONTROLS_MENU_MENU_MODEL_ADAPTER_H_ 6 #define VIEWS_CONTROLS_MENU_MENU_MODEL_ADAPTER_H_
7 #pragma once 7 #pragma once
8 8
9 #include <map> 9 #include <map>
10 10
(...skipping 25 matching lines...) Expand all
36 virtual void ExecuteCommand(int id) OVERRIDE; 36 virtual void ExecuteCommand(int id) OVERRIDE;
37 virtual void ExecuteCommand(int id, int mouse_event_flags) OVERRIDE; 37 virtual void ExecuteCommand(int id, int mouse_event_flags) OVERRIDE;
38 virtual bool GetAccelerator(int id, 38 virtual bool GetAccelerator(int id,
39 views::Accelerator* accelerator) OVERRIDE; 39 views::Accelerator* accelerator) OVERRIDE;
40 virtual std::wstring GetLabel(int id) const OVERRIDE; 40 virtual std::wstring GetLabel(int id) const OVERRIDE;
41 virtual const gfx::Font& GetLabelFont(int id) const OVERRIDE; 41 virtual const gfx::Font& GetLabelFont(int id) const OVERRIDE;
42 virtual bool IsCommandEnabled(int id) const OVERRIDE; 42 virtual bool IsCommandEnabled(int id) const OVERRIDE;
43 virtual bool IsItemChecked(int id) const OVERRIDE; 43 virtual bool IsItemChecked(int id) const OVERRIDE;
44 virtual void SelectionChanged(MenuItemView* menu) OVERRIDE; 44 virtual void SelectionChanged(MenuItemView* menu) OVERRIDE;
45 virtual void WillShowMenu(MenuItemView* menu) OVERRIDE; 45 virtual void WillShowMenu(MenuItemView* menu) OVERRIDE;
46 virtual void WillHideMenu(MenuItemView* menu) OVERRIDE;
46 47
47 private: 48 private:
48 // Implementation of BuildMenu(). index_offset is both input and output; 49 // Implementation of BuildMenu(). index_offset is both input and output;
49 // on input it contains the offset from index to command id for the model, 50 // on input it contains the offset from index to command id for the model,
50 // and on output it contains the offset for the next model. 51 // and on output it contains the offset for the next model.
51 void BuildMenuImpl(MenuItemView* menu, ui::MenuModel* model); 52 void BuildMenuImpl(MenuItemView* menu, ui::MenuModel* model);
52 53
53 // Container of ui::MenuModel pointers as encountered by preorder 54 // Container of ui::MenuModel pointers as encountered by preorder
54 // traversal. The first element is always the top-level model 55 // traversal. The first element is always the top-level model
55 // passed to the constructor. 56 // passed to the constructor.
56 ui::MenuModel* menu_model_; 57 ui::MenuModel* menu_model_;
57 58
58 // Map MenuItems to MenuModels. Used to implement WillShowMenu(). 59 // Map MenuItems to MenuModels. Used to implement WillShowMenu().
59 std::map<MenuItemView*, ui::MenuModel*> menu_map_; 60 std::map<MenuItemView*, ui::MenuModel*> menu_map_;
60 61
61 DISALLOW_COPY_AND_ASSIGN(MenuModelAdapter); 62 DISALLOW_COPY_AND_ASSIGN(MenuModelAdapter);
62 }; 63 };
63 64
64 } // namespace views 65 } // namespace views
65 66
66 #endif // VIEWS_CONTROLS_MENU_MENU_MODEL_ADAPTER_H_ 67 #endif // VIEWS_CONTROLS_MENU_MENU_MODEL_ADAPTER_H_
OLDNEW
« no previous file with comments | « views/controls/menu/menu_item_view.cc ('k') | views/controls/menu/menu_model_adapter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698