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 <string> | 5 #include <string> |
6 #include <vector> | 6 #include <vector> |
7 | 7 |
8 #include "chrome/app/chrome_command_ids.h" | 8 #include "chrome/app/chrome_command_ids.h" |
9 #include "chrome/browser/renderer_context_menu/render_view_context_menu_test_uti
l.h" | 9 #include "chrome/browser/renderer_context_menu/render_view_context_menu_test_uti
l.h" |
10 #include "content/public/browser/web_contents.h" | 10 #include "content/public/browser/web_contents.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 params.link_url = link_url; | 30 params.link_url = link_url; |
31 params.frame_url = frame_url; | 31 params.frame_url = frame_url; |
32 TestRenderViewContextMenu* menu = | 32 TestRenderViewContextMenu* menu = |
33 new TestRenderViewContextMenu(web_contents->GetMainFrame(), params); | 33 new TestRenderViewContextMenu(web_contents->GetMainFrame(), params); |
34 menu->Init(); | 34 menu->Init(); |
35 return menu; | 35 return menu; |
36 } | 36 } |
37 | 37 |
38 bool TestRenderViewContextMenu::GetAcceleratorForCommandId( | 38 bool TestRenderViewContextMenu::GetAcceleratorForCommandId( |
39 int command_id, | 39 int command_id, |
40 ui::Accelerator* accelerator) { | 40 ui::Accelerator* accelerator) const { |
41 // None of our commands have accelerators, so always return false. | 41 // None of our commands have accelerators, so always return false. |
42 return false; | 42 return false; |
43 } | 43 } |
44 | 44 |
45 bool TestRenderViewContextMenu::IsItemPresent(int command_id) { | 45 bool TestRenderViewContextMenu::IsItemPresent(int command_id) { |
46 return menu_model_.GetIndexOfCommandId(command_id) != -1; | 46 return menu_model_.GetIndexOfCommandId(command_id) != -1; |
47 } | 47 } |
48 | 48 |
49 bool TestRenderViewContextMenu::IsItemInRangePresent(int command_id_first, | 49 bool TestRenderViewContextMenu::IsItemInRangePresent(int command_id_first, |
50 int command_id_last) { | 50 int command_id_last) { |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 const base::FilePath& path) { | 85 const base::FilePath& path) { |
86 size_t count = profile_link_paths_.size(); | 86 size_t count = profile_link_paths_.size(); |
87 for (size_t i = 0; i < count; ++i) | 87 for (size_t i = 0; i < count; ++i) |
88 if (profile_link_paths_[i] == path) | 88 if (profile_link_paths_[i] == path) |
89 return IDC_OPEN_LINK_IN_PROFILE_FIRST + static_cast<int>(i); | 89 return IDC_OPEN_LINK_IN_PROFILE_FIRST + static_cast<int>(i); |
90 return -1; | 90 return -1; |
91 } | 91 } |
92 | 92 |
93 void TestRenderViewContextMenu::Show() { | 93 void TestRenderViewContextMenu::Show() { |
94 } | 94 } |
OLD | NEW |