| Index: chrome/browser/extensions/extension_context_menu_browsertest.cc
|
| diff --git a/chrome/browser/extensions/extension_context_menu_browsertest.cc b/chrome/browser/extensions/extension_context_menu_browsertest.cc
|
| index 0338d1135f887de2f3bc47e1d67ee113dbeb85e9..e54cb3a1803ddb1602a2bdc2890ef555ae66b823 100644
|
| --- a/chrome/browser/extensions/extension_context_menu_browsertest.cc
|
| +++ b/chrome/browser/extensions/extension_context_menu_browsertest.cc
|
| @@ -25,6 +25,7 @@
|
|
|
| using WebKit::WebContextMenuData;
|
| using content::WebContents;
|
| +using extensions::MenuItem;
|
| using ui::MenuModel;
|
|
|
| namespace {
|
| @@ -41,9 +42,9 @@ class TestRenderViewContextMenu : public RenderViewContextMenu {
|
|
|
| bool HasExtensionItemWithLabel(const std::string& label) {
|
| string16 label16 = UTF8ToUTF16(label);
|
| - std::map<int, ExtensionMenuItem::Id>::iterator i;
|
| + std::map<int, MenuItem::Id>::iterator i;
|
| for (i = extension_item_map_.begin(); i != extension_item_map_.end(); ++i) {
|
| - const ExtensionMenuItem::Id& id = i->second;
|
| + const MenuItem::Id& id = i->second;
|
| string16 tmp_label;
|
| EXPECT_TRUE(GetItemLabel(id, &tmp_label));
|
| if (tmp_label == label16)
|
| @@ -55,7 +56,7 @@ class TestRenderViewContextMenu : public RenderViewContextMenu {
|
| // Looks in the menu for an extension item with |id|, and if it is found and
|
| // has a label, that is put in |result| and we return true. Otherwise returns
|
| // false.
|
| - bool GetItemLabel(const ExtensionMenuItem::Id& id, string16* result) {
|
| + bool GetItemLabel(const MenuItem::Id& id, string16* result) {
|
| int command_id = 0;
|
| if (!FindCommandId(id, &command_id))
|
| return false;
|
| @@ -97,8 +98,8 @@ class TestRenderViewContextMenu : public RenderViewContextMenu {
|
|
|
| // Given an extension menu item id, tries to find the corresponding command id
|
| // in the menu.
|
| - bool FindCommandId(const ExtensionMenuItem::Id& id, int* command_id) {
|
| - std::map<int, ExtensionMenuItem::Id>::const_iterator i;
|
| + bool FindCommandId(const MenuItem::Id& id, int* command_id) {
|
| + std::map<int, MenuItem::Id>::const_iterator i;
|
| for (i = extension_item_map_.begin(); i != extension_item_map_.end(); ++i) {
|
| if (i->second == id) {
|
| *command_id = i->first;
|
| @@ -156,8 +157,8 @@ class ExtensionContextMenuBrowserTest : public ExtensionBrowserTest {
|
| return menu;
|
| }
|
|
|
| - // Shortcut to return the current ExtensionMenuManager.
|
| - ExtensionMenuManager* menu_manager() {
|
| + // Shortcut to return the current MenuManager.
|
| + extensions::MenuManager* menu_manager() {
|
| return browser()->profile()->GetExtensionService()->menu_manager();
|
| }
|
|
|
| @@ -177,12 +178,12 @@ class ExtensionContextMenuBrowserTest : public ExtensionBrowserTest {
|
|
|
| // This gets all the items that any extension has registered for possible
|
| // inclusion in context menus.
|
| - ExtensionMenuItem::List GetItems() {
|
| - ExtensionMenuItem::List result;
|
| + MenuItem::List GetItems() {
|
| + MenuItem::List result;
|
| std::set<std::string> extension_ids = menu_manager()->ExtensionIds();
|
| std::set<std::string>::iterator i;
|
| for (i = extension_ids.begin(); i != extension_ids.end(); ++i) {
|
| - const ExtensionMenuItem::List* list = menu_manager()->MenuItems(*i);
|
| + const MenuItem::List* list = menu_manager()->MenuItems(*i);
|
| result.insert(result.end(), list->begin(), list->end());
|
| }
|
| return result;
|
| @@ -303,9 +304,9 @@ IN_PROC_BROWSER_TEST_F(ExtensionContextMenuBrowserTest, LongTitle) {
|
|
|
| // Make sure we have an item registered with a long title.
|
| size_t limit = RenderViewContextMenu::kMaxExtensionItemTitleLength;
|
| - ExtensionMenuItem::List items = GetItems();
|
| + MenuItem::List items = GetItems();
|
| ASSERT_EQ(1u, items.size());
|
| - ExtensionMenuItem* item = items.at(0);
|
| + MenuItem* item = items.at(0);
|
| ASSERT_GT(item->title().size(), limit);
|
|
|
| // Create a context menu, then find the item's label. It should be properly
|
| @@ -579,7 +580,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionContextMenuBrowserLazyTest, EventPage) {
|
| LazyBackgroundObserver checkbox_checked;
|
| scoped_ptr<TestRenderViewContextMenu> menu(
|
| CreateMenu(browser(), about_blank, GURL(), GURL()));
|
| - ExtensionMenuItem::Id id(false, extension->id());
|
| + MenuItem::Id id(false, extension->id());
|
| id.string_uid = "checkbox1";
|
| int command_id = -1;
|
| ASSERT_TRUE(menu->FindCommandId(id, &command_id));
|
|
|