| 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/open_with_menu_factory_ash.h" | 5 #include "chrome/browser/renderer_context_menu/open_with_menu_factory_ash.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <unordered_map> | 9 #include <unordered_map> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 bool OpenWithMenuObserver::SubMenuDelegate::IsCommandIdChecked( | 28 bool OpenWithMenuObserver::SubMenuDelegate::IsCommandIdChecked( |
| 29 int command_id) const { | 29 int command_id) const { |
| 30 return false; | 30 return false; |
| 31 } | 31 } |
| 32 | 32 |
| 33 bool OpenWithMenuObserver::SubMenuDelegate::IsCommandIdEnabled( | 33 bool OpenWithMenuObserver::SubMenuDelegate::IsCommandIdEnabled( |
| 34 int command_id) const { | 34 int command_id) const { |
| 35 return true; | 35 return true; |
| 36 } | 36 } |
| 37 | 37 |
| 38 bool OpenWithMenuObserver::SubMenuDelegate::GetAcceleratorForCommandId( | |
| 39 int command_id, | |
| 40 ui::Accelerator* accelerator) const { | |
| 41 return false; | |
| 42 } | |
| 43 | |
| 44 void OpenWithMenuObserver::SubMenuDelegate::ExecuteCommand(int command_id, | 38 void OpenWithMenuObserver::SubMenuDelegate::ExecuteCommand(int command_id, |
| 45 int event_flags) { | 39 int event_flags) { |
| 46 parent_->ExecuteCommand(command_id); | 40 parent_->ExecuteCommand(command_id); |
| 47 } | 41 } |
| 48 | 42 |
| 49 OpenWithMenuObserver::OpenWithMenuObserver(RenderViewContextMenuProxy* proxy) | 43 OpenWithMenuObserver::OpenWithMenuObserver(RenderViewContextMenuProxy* proxy) |
| 50 : proxy_(proxy), | 44 : proxy_(proxy), |
| 51 submenu_delegate_(this), | 45 submenu_delegate_(this), |
| 52 more_apps_label_( | 46 more_apps_label_( |
| 53 l10n_util::GetStringUTF16(IDS_CONTENT_CONTEXT_MORE_APPS)) {} | 47 l10n_util::GetStringUTF16(IDS_CONTENT_CONTEXT_MORE_APPS)) {} |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 } | 183 } |
| 190 } | 184 } |
| 191 | 185 |
| 192 return std::make_pair(std::move(handler_map), submenu_parent_command_id); | 186 return std::make_pair(std::move(handler_map), submenu_parent_command_id); |
| 193 } | 187 } |
| 194 | 188 |
| 195 RenderViewContextMenuObserver* OpenWithMenuFactory::CreateMenu( | 189 RenderViewContextMenuObserver* OpenWithMenuFactory::CreateMenu( |
| 196 RenderViewContextMenuProxy* proxy) { | 190 RenderViewContextMenuProxy* proxy) { |
| 197 return new OpenWithMenuObserver(proxy); | 191 return new OpenWithMenuObserver(proxy); |
| 198 } | 192 } |
| OLD | NEW |