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

Side by Side Diff: app/menus/simple_menu_model.h

Issue 465130: Share the code that builds the page menu in a common model, make Mac and Win ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 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 | « no previous file | chrome/app/nibs/Toolbar.xib » ('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) 2009 The Chromium Authors. All rights reserved. Use of this 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this
2 // source code is governed by a BSD-style license that can be found in the 2 // source code is governed by a BSD-style license that can be found in the
3 // LICENSE file. 3 // LICENSE file.
4 4
5 #ifndef APP_MENUS_SIMPLE_MENU_MODEL_H_ 5 #ifndef APP_MENUS_SIMPLE_MENU_MODEL_H_
6 #define APP_MENUS_SIMPLE_MENU_MODEL_H_ 6 #define APP_MENUS_SIMPLE_MENU_MODEL_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/string16.h" 10 #include "base/string16.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 virtual MenuModel* GetSubmenuModelAt(int index) const; 80 virtual MenuModel* GetSubmenuModelAt(int index) const;
81 81
82 protected: 82 protected:
83 // Some variants of this model (SystemMenuModel) relies on items to be 83 // Some variants of this model (SystemMenuModel) relies on items to be
84 // inserted backwards. This is counter-intuitive for the API, so rather than 84 // inserted backwards. This is counter-intuitive for the API, so rather than
85 // forcing customers to insert things backwards, we return the indices 85 // forcing customers to insert things backwards, we return the indices
86 // backwards instead. That's what this method is for. By default, it just 86 // backwards instead. That's what this method is for. By default, it just
87 // returns what it's passed. 87 // returns what it's passed.
88 virtual int FlipIndex(int index) const { return index; } 88 virtual int FlipIndex(int index) const { return index; }
89 89
90 Delegate* delegate() { return delegate_; }
91
90 private: 92 private:
91 struct Item { 93 struct Item {
92 int command_id; 94 int command_id;
93 string16 label; 95 string16 label;
94 ItemType type; 96 ItemType type;
95 int group_id; 97 int group_id;
96 MenuModel* submenu; 98 MenuModel* submenu;
97 }; 99 };
98 std::vector<Item> items_; 100 std::vector<Item> items_;
99 101
100 Delegate* delegate_; 102 Delegate* delegate_;
101 103
102 DISALLOW_COPY_AND_ASSIGN(SimpleMenuModel); 104 DISALLOW_COPY_AND_ASSIGN(SimpleMenuModel);
103 }; 105 };
104 106
105 } // namespace menus 107 } // namespace menus
106 108
107 #endif // APP_MENUS_SIMPLE_MENU_MODEL_H_ 109 #endif // APP_MENUS_SIMPLE_MENU_MODEL_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/app/nibs/Toolbar.xib » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698