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

Unified Diff: ui/base/models/simple_menu_model.cc

Issue 10837317: Setting the touch wrench menu as default menu for ChromeOS (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: ui/base/models/simple_menu_model.cc
diff --git a/ui/base/models/simple_menu_model.cc b/ui/base/models/simple_menu_model.cc
index 7537faf5a268c982770672836ead0f20b7fb2049..181e10f8b0eaa81084fe9729192c162895712b55 100644
--- a/ui/base/models/simple_menu_model.cc
+++ b/ui/base/models/simple_menu_model.cc
@@ -80,9 +80,12 @@ void SimpleMenuModel::AddItemWithStringId(int command_id, int string_id) {
AddItem(command_id, l10n_util::GetStringUTF16(string_id));
}
-void SimpleMenuModel::AddSeparator() {
- Item item = { kSeparatorId, string16(), gfx::ImageSkia(), TYPE_SEPARATOR, -1,
- NULL, NULL };
+void SimpleMenuModel::AddSeparator(const string16& separator_type) {
+#if defined(OS_WINDOWS)
+ DCHECK(separator_type == MenuModel::NORMAL_SEPARATOR)
+#endif
+ Item item = { kSeparatorId, separator_type, gfx::ImageSkia(), TYPE_SEPARATOR,
sky 2012/08/20 15:58:17 Embedding the separator type in the label is a hac
Mr4D (OOO till 08-26) 2012/08/21 01:13:18 Okay, done.
+ -1, NULL, NULL };
AppendItem(item);
}
@@ -139,9 +142,13 @@ void SimpleMenuModel::InsertItemWithStringIdAt(
InsertItemAt(index, command_id, l10n_util::GetStringUTF16(string_id));
}
-void SimpleMenuModel::InsertSeparatorAt(int index) {
- Item item = { kSeparatorId, string16(), gfx::ImageSkia(), TYPE_SEPARATOR, -1,
- NULL, NULL };
+void SimpleMenuModel::InsertSeparatorAt(int index,
+ const string16& separator_type) {
+#if defined(OS_WINDOWS)
+ DCHECK(separator_type == MenuModel::NORMAL_SEPARATOR)
+#endif
+ Item item = { kSeparatorId, separator_type, gfx::ImageSkia(), TYPE_SEPARATOR,
+ -1, NULL, NULL };
InsertItemAtIndex(item, index);
}

Powered by Google App Engine
This is Rietveld 408576698