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