Chromium Code Reviews| 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); |
| } |