OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_TAB_CONTENTS_CONTEXT_MENU_UTILS_H_ |
| 6 #define CHROME_BROWSER_TAB_CONTENTS_CONTEXT_MENU_UTILS_H_ |
| 7 #pragma once |
| 8 |
| 9 #include <string> |
| 10 #include <vector> |
| 11 |
| 12 #include "chrome/browser/extensions/extension_menu_manager.h" |
| 13 #include "webkit/glue/context_menu.h" |
| 14 |
| 15 class ExtensionService; |
| 16 class Profile; |
| 17 using WebKit::WebContextMenuData; |
| 18 |
| 19 // Context menu utilities. |
| 20 class ContextMenuUtils { |
| 21 public: |
| 22 // Gets document url out of context menu paramaters. |
| 23 static const GURL& GetDocumentURL(const ContextMenuParams& params); |
| 24 |
| 25 // Given a list of items, returns the ones that match given the contents |
| 26 // of |params| and the profile. |
| 27 static ExtensionMenuItem::List GetRelevantExtensionItems( |
| 28 const ExtensionMenuItem::List& items, |
| 29 const ContextMenuParams& params, |
| 30 Profile* profile, |
| 31 bool can_cross_incognito); |
| 32 |
| 33 // Get a list of extension id's that have context menu items, and sort it by |
| 34 // the extension's name. |
| 35 static void GetSortedContextMenuExtensionIds( |
| 36 ExtensionService* service, |
| 37 ExtensionMenuManager* menu_manager, |
| 38 std::vector<std::pair<std::string, std::string> >* sorted_ids); |
| 39 |
| 40 private: |
| 41 ContextMenuUtils() {} |
| 42 DISALLOW_COPY_AND_ASSIGN(ContextMenuUtils); |
| 43 }; |
| 44 |
| 45 #endif // CHROME_BROWSER_TAB_CONTENTS_CONTEXT_MENU_UTILS_H_ |
OLD | NEW |