OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_EXTENSIONS_CONTEXT_MENU_MATCHER_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_CONTEXT_MENU_MATCHER_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_CONTEXT_MENU_MATCHER_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_CONTEXT_MENU_MATCHER_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
| 11 #include <memory> |
11 #include <vector> | 12 #include <vector> |
12 | 13 |
13 #include "base/callback.h" | 14 #include "base/callback.h" |
14 #include "base/macros.h" | 15 #include "base/macros.h" |
15 #include "base/memory/scoped_ptr.h" | |
16 #include "chrome/browser/extensions/menu_manager.h" | 16 #include "chrome/browser/extensions/menu_manager.h" |
17 #include "ui/base/models/simple_menu_model.h" | 17 #include "ui/base/models/simple_menu_model.h" |
18 | 18 |
19 class ExtensionContextMenuBrowserTest; | 19 class ExtensionContextMenuBrowserTest; |
20 | 20 |
21 namespace content { | 21 namespace content { |
22 class BrowserContext; | 22 class BrowserContext; |
23 class RenderFrameHost; | 23 class RenderFrameHost; |
24 } | 24 } |
25 | 25 |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 content::BrowserContext* browser_context_; | 100 content::BrowserContext* browser_context_; |
101 ui::SimpleMenuModel* menu_model_; | 101 ui::SimpleMenuModel* menu_model_; |
102 ui::SimpleMenuModel::Delegate* delegate_; | 102 ui::SimpleMenuModel::Delegate* delegate_; |
103 | 103 |
104 base::Callback<bool(const MenuItem*)> filter_; | 104 base::Callback<bool(const MenuItem*)> filter_; |
105 | 105 |
106 // Maps the id from a context menu item to the MenuItem's internal id. | 106 // Maps the id from a context menu item to the MenuItem's internal id. |
107 std::map<int, extensions::MenuItem::Id> extension_item_map_; | 107 std::map<int, extensions::MenuItem::Id> extension_item_map_; |
108 | 108 |
109 // Keep track of and clean up menu models for submenus. | 109 // Keep track of and clean up menu models for submenus. |
110 std::vector<scoped_ptr<ui::SimpleMenuModel>> extension_menu_models_; | 110 std::vector<std::unique_ptr<ui::SimpleMenuModel>> extension_menu_models_; |
111 | 111 |
112 DISALLOW_COPY_AND_ASSIGN(ContextMenuMatcher); | 112 DISALLOW_COPY_AND_ASSIGN(ContextMenuMatcher); |
113 }; | 113 }; |
114 | 114 |
115 } // namespace extensions | 115 } // namespace extensions |
116 | 116 |
117 #endif // CHROME_BROWSER_EXTENSIONS_CONTEXT_MENU_MATCHER_H_ | 117 #endif // CHROME_BROWSER_EXTENSIONS_CONTEXT_MENU_MATCHER_H_ |
OLD | NEW |