| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_RENDERER_CONTEXT_MENU_RENDER_VIEW_CONTEXT_MENU_TEST_UTIL_
H_ | 5 #ifndef CHROME_BROWSER_RENDERER_CONTEXT_MENU_RENDER_VIEW_CONTEXT_MENU_TEST_UTIL_
H_ |
| 6 #define CHROME_BROWSER_RENDERER_CONTEXT_MENU_RENDER_VIEW_CONTEXT_MENU_TEST_UTIL_
H_ | 6 #define CHROME_BROWSER_RENDERER_CONTEXT_MENU_RENDER_VIEW_CONTEXT_MENU_TEST_UTIL_
H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "chrome/browser/renderer_context_menu/render_view_context_menu.h" | 12 #include "chrome/browser/renderer_context_menu/render_view_context_menu.h" |
| 13 #include "extensions/features/features.h" |
| 13 #include "url/gurl.h" | 14 #include "url/gurl.h" |
| 14 | 15 |
| 15 #if defined(ENABLE_EXTENSIONS) | 16 #if BUILDFLAG(ENABLE_EXTENSIONS) |
| 16 #include "chrome/browser/extensions/context_menu_matcher.h" | 17 #include "chrome/browser/extensions/context_menu_matcher.h" |
| 17 #endif | 18 #endif |
| 18 | 19 |
| 19 class Browser; | 20 class Browser; |
| 20 | 21 |
| 21 namespace content { | 22 namespace content { |
| 22 class WebContents; | 23 class WebContents; |
| 23 } | 24 } |
| 24 namespace ui { | 25 namespace ui { |
| 25 class MenuModel; | 26 class MenuModel; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 53 // Searches for an menu item with |command_id|. If it's found, the return | 54 // Searches for an menu item with |command_id|. If it's found, the return |
| 54 // value is true and the model and index where it appears in that model are | 55 // value is true and the model and index where it appears in that model are |
| 55 // returned in |found_model| and |found_index|. Otherwise returns false. | 56 // returned in |found_model| and |found_index|. Otherwise returns false. |
| 56 bool GetMenuModelAndItemIndex(int command_id, | 57 bool GetMenuModelAndItemIndex(int command_id, |
| 57 ui::MenuModel** found_model, | 58 ui::MenuModel** found_model, |
| 58 int* found_index); | 59 int* found_index); |
| 59 | 60 |
| 60 // Returns the command id of the menu item with the specified |path|. | 61 // Returns the command id of the menu item with the specified |path|. |
| 61 int GetCommandIDByProfilePath(const base::FilePath& path); | 62 int GetCommandIDByProfilePath(const base::FilePath& path); |
| 62 | 63 |
| 63 #if defined(ENABLE_EXTENSIONS) | 64 #if BUILDFLAG(ENABLE_EXTENSIONS) |
| 64 extensions::ContextMenuMatcher& extension_items() { return extension_items_; } | 65 extensions::ContextMenuMatcher& extension_items() { return extension_items_; } |
| 65 #endif | 66 #endif |
| 66 | 67 |
| 67 void set_protocol_handler_registry(ProtocolHandlerRegistry* registry) { | 68 void set_protocol_handler_registry(ProtocolHandlerRegistry* registry) { |
| 68 protocol_handler_registry_ = registry; | 69 protocol_handler_registry_ = registry; |
| 69 } | 70 } |
| 70 | 71 |
| 71 using RenderViewContextMenu::AppendImageItems; | 72 using RenderViewContextMenu::AppendImageItems; |
| 72 | 73 |
| 73 void Show() override; | 74 void Show() override; |
| 74 | 75 |
| 75 private: | 76 private: |
| 76 DISALLOW_COPY_AND_ASSIGN(TestRenderViewContextMenu); | 77 DISALLOW_COPY_AND_ASSIGN(TestRenderViewContextMenu); |
| 77 }; | 78 }; |
| 78 | 79 |
| 79 #endif // CHROME_BROWSER_RENDERER_CONTEXT_MENU_RENDER_VIEW_CONTEXT_MENU_TEST_UT
IL_H_ | 80 #endif // CHROME_BROWSER_RENDERER_CONTEXT_MENU_RENDER_VIEW_CONTEXT_MENU_TEST_UT
IL_H_ |
| OLD | NEW |