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 "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "chrome/browser/extensions/context_menu_matcher.h" | 9 #include "chrome/browser/extensions/context_menu_matcher.h" |
10 #include "chrome/browser/renderer_context_menu/render_view_context_menu.h" | 10 #include "chrome/browser/renderer_context_menu/render_view_context_menu.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 // instance. | 30 // instance. |
31 // Use the constructor if you want to create menu with fine-grained params. | 31 // Use the constructor if you want to create menu with fine-grained params. |
32 static TestRenderViewContextMenu* Create(content::WebContents* web_contents, | 32 static TestRenderViewContextMenu* Create(content::WebContents* web_contents, |
33 const GURL& page_url, | 33 const GURL& page_url, |
34 const GURL& link_url, | 34 const GURL& link_url, |
35 const GURL& frame_url); | 35 const GURL& frame_url); |
36 | 36 |
37 // Implementation of pure virtuals in RenderViewContextMenu. | 37 // Implementation of pure virtuals in RenderViewContextMenu. |
38 virtual bool GetAcceleratorForCommandId( | 38 virtual bool GetAcceleratorForCommandId( |
39 int command_id, | 39 int command_id, |
40 ui::Accelerator* accelerator) OVERRIDE; | 40 ui::Accelerator* accelerator) override; |
41 | 41 |
42 // Returns true if command specified by |command_id| is present | 42 // Returns true if command specified by |command_id| is present |
43 // in the menu. | 43 // in the menu. |
44 // List of command ids can be found in chrome/app/chrome_command_ids.h. | 44 // List of command ids can be found in chrome/app/chrome_command_ids.h. |
45 bool IsItemPresent(int command_id); | 45 bool IsItemPresent(int command_id); |
46 | 46 |
47 // Searches for an menu item with |command_id|. If it's found, the return | 47 // Searches for an menu item with |command_id|. If it's found, the return |
48 // value is true and the model and index where it appears in that model are | 48 // value is true and the model and index where it appears in that model are |
49 // returned in |found_model| and |found_index|. Otherwise returns false. | 49 // returned in |found_model| and |found_index|. Otherwise returns false. |
50 bool GetMenuModelAndItemIndex(int command_id, | 50 bool GetMenuModelAndItemIndex(int command_id, |
51 ui::MenuModel** found_model, | 51 ui::MenuModel** found_model, |
52 int* found_index); | 52 int* found_index); |
53 | 53 |
54 extensions::ContextMenuMatcher& extension_items() { return extension_items_; } | 54 extensions::ContextMenuMatcher& extension_items() { return extension_items_; } |
55 | 55 |
56 private: | 56 private: |
57 DISALLOW_COPY_AND_ASSIGN(TestRenderViewContextMenu); | 57 DISALLOW_COPY_AND_ASSIGN(TestRenderViewContextMenu); |
58 }; | 58 }; |
59 | 59 |
60 #endif // CHROME_BROWSER_RENDERER_CONTEXT_MENU_RENDER_VIEW_CONTEXT_MENU_TEST_UT
IL_H_ | 60 #endif // CHROME_BROWSER_RENDERER_CONTEXT_MENU_RENDER_VIEW_CONTEXT_MENU_TEST_UT
IL_H_ |
OLD | NEW |