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 #include "chrome/browser/renderer_context_menu/render_view_context_menu_test_uti
l.h" | 5 #include "chrome/browser/renderer_context_menu/render_view_context_menu_test_uti
l.h" |
6 #include "content/public/browser/web_contents.h" | 6 #include "content/public/browser/web_contents.h" |
7 #include "ui/base/models/menu_model.h" | 7 #include "ui/base/models/menu_model.h" |
8 | 8 |
9 using ui::MenuModel; | 9 using ui::MenuModel; |
10 | 10 |
(...skipping 13 matching lines...) Expand all Loading... |
24 content::ContextMenuParams params; | 24 content::ContextMenuParams params; |
25 params.page_url = page_url; | 25 params.page_url = page_url; |
26 params.link_url = link_url; | 26 params.link_url = link_url; |
27 params.frame_url = frame_url; | 27 params.frame_url = frame_url; |
28 TestRenderViewContextMenu* menu = | 28 TestRenderViewContextMenu* menu = |
29 new TestRenderViewContextMenu(web_contents->GetMainFrame(), params); | 29 new TestRenderViewContextMenu(web_contents->GetMainFrame(), params); |
30 menu->Init(); | 30 menu->Init(); |
31 return menu; | 31 return menu; |
32 } | 32 } |
33 | 33 |
34 void TestRenderViewContextMenu::PlatformInit() {} | |
35 | |
36 void TestRenderViewContextMenu::PlatformCancel() {} | |
37 | |
38 bool TestRenderViewContextMenu::GetAcceleratorForCommandId( | 34 bool TestRenderViewContextMenu::GetAcceleratorForCommandId( |
39 int command_id, | 35 int command_id, |
40 ui::Accelerator* accelerator) { | 36 ui::Accelerator* accelerator) { |
41 // None of our commands have accelerators, so always return false. | 37 // None of our commands have accelerators, so always return false. |
42 return false; | 38 return false; |
43 } | 39 } |
44 | 40 |
45 bool TestRenderViewContextMenu::IsItemPresent(int command_id) { | 41 bool TestRenderViewContextMenu::IsItemPresent(int command_id) { |
46 return menu_model_.GetIndexOfCommandId(command_id) != -1; | 42 return menu_model_.GetIndexOfCommandId(command_id) != -1; |
47 } | 43 } |
(...skipping 14 matching lines...) Expand all Loading... |
62 *found_index = i; | 58 *found_index = i; |
63 return true; | 59 return true; |
64 } else if (model->GetTypeAt(i) == MenuModel::TYPE_SUBMENU) { | 60 } else if (model->GetTypeAt(i) == MenuModel::TYPE_SUBMENU) { |
65 models_to_search.push_back(model->GetSubmenuModelAt(i)); | 61 models_to_search.push_back(model->GetSubmenuModelAt(i)); |
66 } | 62 } |
67 } | 63 } |
68 } | 64 } |
69 | 65 |
70 return false; | 66 return false; |
71 } | 67 } |
OLD | NEW |