| Index: views/controls/menu/menu_item_view.h
|
| diff --git a/views/controls/menu/menu_item_view.h b/views/controls/menu/menu_item_view.h
|
| index 308c3e20aafd0a41f63ae966a6ef89be934615d3..8ebc64e05996afd598a55ccb77650a0f91aa67bb 100644
|
| --- a/views/controls/menu/menu_item_view.h
|
| +++ b/views/controls/menu/menu_item_view.h
|
| @@ -7,6 +7,7 @@
|
| #pragma once
|
|
|
| #include <string>
|
| +#include <vector>
|
|
|
| #if defined(OS_WIN)
|
| #include <windows.h>
|
| @@ -127,7 +128,20 @@ class MenuItemView : public View {
|
| // Hides and cancels the menu. This does nothing if the menu is not open.
|
| void Cancel();
|
|
|
| - // Adds an item to this menu.
|
| + // Add an item to the menu at a specified index. ChildrenChanged() should
|
| + // called after adding menu items if the menu may be active.
|
| + MenuItemView* AddMenuItemAt(int index,
|
| + int item_id,
|
| + const std::wstring& label,
|
| + const SkBitmap& icon,
|
| + Type type);
|
| +
|
| + // Remove an item from the menu at a specified index.
|
| + // ChildrenChanged() should be called after removing menu items (whether
|
| + // the menu may be active or not).
|
| + void RemoveMenuItemAt(int index);
|
| +
|
| + // Appends an item to this menu.
|
| // item_id The id of the item, used to identify it in delegate callbacks
|
| // or (if delegate is NULL) to identify the command associated
|
| // with this item with the controller specified in the ctor. Note
|
| @@ -423,6 +437,9 @@ class MenuItemView : public View {
|
| // GetPreferredSize.
|
| gfx::Size pref_size_;
|
|
|
| + // Removed items to be deleted in ChildrenChanged().
|
| + std::vector<View*> removed_items_;
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(MenuItemView);
|
| };
|
|
|
|
|