OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "ash/renderer_context_menu/open_with_menu_controller.h" |
| 6 |
| 7 namespace ash { |
| 8 |
| 9 OpenWithMenuController::OpenWithMenuController() : delegate_(nullptr) {} |
| 10 |
| 11 void OpenWithMenuController::SetDelegate(Delegate* delegate) { |
| 12 delegate_ = delegate; |
| 13 } |
| 14 |
| 15 int OpenWithMenuController::PopulateOpenWithMenu( |
| 16 RenderViewContextMenuProxy* proxy, |
| 17 int menu_id_start, |
| 18 size_t num_menu_items, |
| 19 const GURL& url) { |
| 20 if (delegate_) |
| 21 return delegate_->PopulateOpenWithMenu(proxy, menu_id_start, num_menu_items, |
| 22 url); |
| 23 return 0; |
| 24 } |
| 25 |
| 26 void OpenWithMenuController::ExecuteCommand(int id) { |
| 27 if (delegate_) |
| 28 delegate_->ExecuteCommand(id); |
| 29 } |
| 30 |
| 31 void OpenWithMenuController::MenuClosed() { |
| 32 if (delegate_) |
| 33 delegate_->MenuClosed(); |
| 34 } |
| 35 |
| 36 } // namespace ash |
OLD | NEW |