| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/mock_render_view_context_menu.h" | 5 #include "chrome/browser/renderer_context_menu/mock_render_view_context_menu.h" |
| 6 | 6 |
| 7 #include "chrome/app/chrome_command_ids.h" | 7 #include "chrome/app/chrome_command_ids.h" |
| 8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
| 9 #include "chrome/grit/generated_resources.h" | 9 #include "chrome/grit/generated_resources.h" |
| 10 #include "chrome/test/base/testing_profile.h" | 10 #include "chrome/test/base/testing_profile.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 | 44 |
| 45 void MockRenderViewContextMenu::ExecuteCommand(int command_id, | 45 void MockRenderViewContextMenu::ExecuteCommand(int command_id, |
| 46 int event_flags) { | 46 int event_flags) { |
| 47 observer_->ExecuteCommand(command_id); | 47 observer_->ExecuteCommand(command_id); |
| 48 } | 48 } |
| 49 | 49 |
| 50 void MockRenderViewContextMenu::MenuWillShow(ui::SimpleMenuModel* source) {} | 50 void MockRenderViewContextMenu::MenuWillShow(ui::SimpleMenuModel* source) {} |
| 51 | 51 |
| 52 void MockRenderViewContextMenu::MenuClosed(ui::SimpleMenuModel* source) {} | 52 void MockRenderViewContextMenu::MenuClosed(ui::SimpleMenuModel* source) {} |
| 53 | 53 |
| 54 bool MockRenderViewContextMenu::GetAcceleratorForCommandId( | |
| 55 int command_id, | |
| 56 ui::Accelerator* accelerator) const { | |
| 57 return false; | |
| 58 } | |
| 59 | |
| 60 void MockRenderViewContextMenu::AddMenuItem(int command_id, | 54 void MockRenderViewContextMenu::AddMenuItem(int command_id, |
| 61 const base::string16& title) { | 55 const base::string16& title) { |
| 62 MockMenuItem item; | 56 MockMenuItem item; |
| 63 item.command_id = command_id; | 57 item.command_id = command_id; |
| 64 item.enabled = observer_->IsCommandIdEnabled(command_id); | 58 item.enabled = observer_->IsCommandIdEnabled(command_id); |
| 65 item.checked = false; | 59 item.checked = false; |
| 66 item.hidden = false; | 60 item.hidden = false; |
| 67 item.title = title; | 61 item.title = title; |
| 68 items_.push_back(item); | 62 items_.push_back(item); |
| 69 } | 63 } |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 MockMenuItem* item) const { | 172 MockMenuItem* item) const { |
| 179 if (index >= items_.size()) | 173 if (index >= items_.size()) |
| 180 return false; | 174 return false; |
| 181 *item = items_[index]; | 175 *item = items_[index]; |
| 182 return true; | 176 return true; |
| 183 } | 177 } |
| 184 | 178 |
| 185 PrefService* MockRenderViewContextMenu::GetPrefs() { | 179 PrefService* MockRenderViewContextMenu::GetPrefs() { |
| 186 return profile_->GetPrefs(); | 180 return profile_->GetPrefs(); |
| 187 } | 181 } |
| OLD | NEW |