| 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 | 7 |
| 8 #include "chrome/app/chrome_command_ids.h" |
| 7 #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" |
| 8 #include "content/public/browser/web_contents.h" | 10 #include "content/public/browser/web_contents.h" |
| 9 #include "ui/base/models/menu_model.h" | 11 #include "ui/base/models/menu_model.h" |
| 10 | 12 |
| 11 using ui::MenuModel; | 13 using ui::MenuModel; |
| 12 | 14 |
| 13 TestRenderViewContextMenu::TestRenderViewContextMenu( | 15 TestRenderViewContextMenu::TestRenderViewContextMenu( |
| 14 content::RenderFrameHost* render_frame_host, | 16 content::RenderFrameHost* render_frame_host, |
| 15 content::ContextMenuParams params) | 17 content::ContextMenuParams params) |
| 16 : RenderViewContextMenu(render_frame_host, params) {} | 18 : RenderViewContextMenu(render_frame_host, params) {} |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 return true; | 74 return true; |
| 73 } else if (model->GetTypeAt(i) == MenuModel::TYPE_SUBMENU) { | 75 } else if (model->GetTypeAt(i) == MenuModel::TYPE_SUBMENU) { |
| 74 models_to_search.push_back(model->GetSubmenuModelAt(i)); | 76 models_to_search.push_back(model->GetSubmenuModelAt(i)); |
| 75 } | 77 } |
| 76 } | 78 } |
| 77 } | 79 } |
| 78 | 80 |
| 79 return false; | 81 return false; |
| 80 } | 82 } |
| 81 | 83 |
| 82 size_t TestRenderViewContextMenu::GetItemIndexByProfilePath( | 84 int TestRenderViewContextMenu::GetCommandIDByProfilePath( |
| 83 const base::FilePath& path) { | 85 const base::FilePath& path) { |
| 84 size_t count = profile_link_paths_.size(); | 86 size_t count = profile_link_paths_.size(); |
| 85 for (size_t i = 0; i < count; ++i) | 87 for (size_t i = 0; i < count; ++i) |
| 86 if (profile_link_paths_[i] == path) | 88 if (profile_link_paths_[i] == path) |
| 87 return i; | 89 return IDC_OPEN_LINK_IN_PROFILE_FIRST + static_cast<int>(i); |
| 88 return std::string::npos; | 90 return -1; |
| 89 } | 91 } |
| 90 | 92 |
| 91 void TestRenderViewContextMenu::Show() { | 93 void TestRenderViewContextMenu::Show() { |
| 92 } | 94 } |
| OLD | NEW |