 Chromium Code Reviews
 Chromium Code Reviews Issue 359493005:
  Extend contextMenus API to support browser/page actions  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@master
    
  
    Issue 359493005:
  Extend contextMenus API to support browser/page actions  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@master| Index: chrome/browser/extensions/context_menu_matcher.h | 
| diff --git a/chrome/browser/extensions/context_menu_matcher.h b/chrome/browser/extensions/context_menu_matcher.h | 
| index 782b8d3fd6db201fb1f20eb8746d37c25e67b1d6..85bd772bd9031fedcb975573e95bac94f5ef5bb6 100644 | 
| --- a/chrome/browser/extensions/context_menu_matcher.h | 
| +++ b/chrome/browser/extensions/context_menu_matcher.h | 
| @@ -14,6 +14,7 @@ | 
| #include "ui/base/models/simple_menu_model.h" | 
| class ExtensionContextMenuBrowserTest; | 
| +class ExtensionContextMenuModelTest; | 
| class Profile; | 
| namespace extensions { | 
| @@ -33,10 +34,13 @@ class ContextMenuMatcher { | 
| // This is a helper function to append items for one particular extension. | 
| // The |index| parameter is used for assigning id's, and is incremented for | 
| - // each item actually added. | 
| + // each item actually added. |is_action_menu| is used for browser and page | 
| + // action context menus, in which menu items are not placed in submenus | 
| + // and the extension's icon is not shown. | 
| void AppendExtensionItems(const MenuItem::ExtensionKey& extension_key, | 
| const base::string16& selection_text, | 
| - int* index); | 
| + int* index, | 
| + bool is_action_menu); | 
| void Clear(); | 
| @@ -54,6 +58,7 @@ class ContextMenuMatcher { | 
| private: | 
| friend class ::ExtensionContextMenuBrowserTest; | 
| + friend class ::ExtensionContextMenuModelTest; | 
| 
Devlin
2014/07/29 20:49:45
Do we need this?
 
gpdavis
2014/07/30 20:53:02
Oops, no, we don't.  I had an idea that would have
 | 
| bool GetRelevantExtensionTopLevelItems( | 
| const MenuItem::ExtensionKey& extension_key, | 
| @@ -70,7 +75,8 @@ class ContextMenuMatcher { | 
| bool can_cross_incognito, | 
| const base::string16& selection_text, | 
| ui::SimpleMenuModel* menu_model, | 
| - int* index); | 
| + int* index, | 
| + bool is_action_menu_top_level); | 
| // Attempts to get an MenuItem given the id of a context menu item. | 
| extensions::MenuItem* GetExtensionMenuItem(int id) const; |