| Index: ui/views/controls/menu/menu_item_view.cc
|
| diff --git a/ui/views/controls/menu/menu_item_view.cc b/ui/views/controls/menu/menu_item_view.cc
|
| index f89648cd4d3a5f28e11378d5f9c62845d1ac6b48..aedc3de19d9dc8d24604fa5fbd068df1f9dfbadc 100644
|
| --- a/ui/views/controls/menu/menu_item_view.cc
|
| +++ b/ui/views/controls/menu/menu_item_view.cc
|
| @@ -205,18 +205,20 @@ void MenuItemView::Cancel() {
|
| }
|
| }
|
|
|
| -MenuItemView* MenuItemView::AddMenuItemAt(int index,
|
| - int item_id,
|
| - const string16& label,
|
| - const gfx::ImageSkia& icon,
|
| - Type type) {
|
| +MenuItemView* MenuItemView::AddMenuItemAt(
|
| + int index,
|
| + int item_id,
|
| + const string16& label,
|
| + const gfx::ImageSkia& icon,
|
| + Type type,
|
| + ui::MenuSeparatorType separator_style) {
|
| DCHECK_NE(type, EMPTY);
|
| DCHECK_LE(0, index);
|
| if (!submenu_)
|
| CreateSubmenu();
|
| DCHECK_GE(submenu_->child_count(), index);
|
| if (type == SEPARATOR) {
|
| - submenu_->AddChildViewAt(new MenuSeparator(), index);
|
| + submenu_->AddChildViewAt(new MenuSeparator(separator_style), index);
|
| return NULL;
|
| }
|
| MenuItemView* item = new MenuItemView(this, item_id, type);
|
| @@ -250,18 +252,21 @@ void MenuItemView::RemoveMenuItemAt(int index) {
|
| MenuItemView* MenuItemView::AppendMenuItem(int item_id,
|
| const string16& label,
|
| Type type) {
|
| - return AppendMenuItemImpl(item_id, label, gfx::ImageSkia(), type);
|
| + return AppendMenuItemImpl(item_id, label, gfx::ImageSkia(), type,
|
| + ui::NORMAL_SEPARATOR);
|
| }
|
|
|
| MenuItemView* MenuItemView::AppendSubMenu(int item_id,
|
| const string16& label) {
|
| - return AppendMenuItemImpl(item_id, label, gfx::ImageSkia(), SUBMENU);
|
| + return AppendMenuItemImpl(item_id, label, gfx::ImageSkia(), SUBMENU,
|
| + ui::NORMAL_SEPARATOR);
|
| }
|
|
|
| MenuItemView* MenuItemView::AppendSubMenuWithIcon(int item_id,
|
| const string16& label,
|
| const gfx::ImageSkia& icon) {
|
| - return AppendMenuItemImpl(item_id, label, icon, SUBMENU);
|
| + return AppendMenuItemImpl(
|
| + item_id, label, icon, SUBMENU, ui::NORMAL_SEPARATOR);
|
| }
|
|
|
| MenuItemView* MenuItemView::AppendMenuItemWithLabel(int item_id,
|
| @@ -274,13 +279,15 @@ MenuItemView* MenuItemView::AppendDelegateMenuItem(int item_id) {
|
| }
|
|
|
| void MenuItemView::AppendSeparator() {
|
| - AppendMenuItemImpl(0, string16(), gfx::ImageSkia(), SEPARATOR);
|
| + AppendMenuItemImpl(
|
| + 0, string16(), gfx::ImageSkia(), SEPARATOR, ui::NORMAL_SEPARATOR);
|
| }
|
|
|
| MenuItemView* MenuItemView::AppendMenuItemWithIcon(int item_id,
|
| const string16& label,
|
| const gfx::ImageSkia& icon) {
|
| - return AppendMenuItemImpl(item_id, label, icon, NORMAL);
|
| + return AppendMenuItemImpl(
|
| + item_id, label, icon, NORMAL, ui::NORMAL_SEPARATOR);
|
| }
|
|
|
| MenuItemView* MenuItemView::AppendMenuItemFromModel(ui::MenuModel* model,
|
| @@ -288,6 +295,7 @@ MenuItemView* MenuItemView::AppendMenuItemFromModel(ui::MenuModel* model,
|
| int id) {
|
| gfx::ImageSkia icon;
|
| string16 label;
|
| + ui::MenuSeparatorType separator_style = ui::NORMAL_SEPARATOR;
|
| MenuItemView::Type type;
|
| ui::MenuModel::ItemType menu_type = model->GetTypeAt(index);
|
| switch (menu_type) {
|
| @@ -306,6 +314,7 @@ MenuItemView* MenuItemView::AppendMenuItemFromModel(ui::MenuModel* model,
|
| break;
|
| case ui::MenuModel::TYPE_SEPARATOR:
|
| type = MenuItemView::SEPARATOR;
|
| + separator_style = model->GetSeparatorTypeAt(index);
|
| break;
|
| case ui::MenuModel::TYPE_SUBMENU:
|
| model->GetIconAt(index, &icon);
|
| @@ -318,15 +327,17 @@ MenuItemView* MenuItemView::AppendMenuItemFromModel(ui::MenuModel* model,
|
| break;
|
| }
|
|
|
| - return AppendMenuItemImpl(id, label, icon, type);
|
| + return AppendMenuItemImpl(id, label, icon, type, separator_style);
|
| }
|
|
|
| -MenuItemView* MenuItemView::AppendMenuItemImpl(int item_id,
|
| - const string16& label,
|
| - const gfx::ImageSkia& icon,
|
| - Type type) {
|
| +MenuItemView* MenuItemView::AppendMenuItemImpl(
|
| + int item_id,
|
| + const string16& label,
|
| + const gfx::ImageSkia& icon,
|
| + Type type,
|
| + ui::MenuSeparatorType separator_style) {
|
| const int index = submenu_ ? submenu_->child_count() : 0;
|
| - return AddMenuItemAt(index, item_id, label, icon, type);
|
| + return AddMenuItemAt(index, item_id, label, icon, type, separator_style);
|
| }
|
|
|
| SubmenuView* MenuItemView::CreateSubmenu() {
|
|
|