| 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 "chrome/browser/guest_view/app_view/chrome_app_view_guest_delegate.h" |
| 6 |
| 7 #include <utility> |
| 8 |
| 5 #include "chrome/browser/apps/scoped_keep_alive.h" | 9 #include "chrome/browser/apps/scoped_keep_alive.h" |
| 6 #include "chrome/browser/guest_view/app_view/chrome_app_view_guest_delegate.h" | |
| 7 #include "chrome/browser/renderer_context_menu/render_view_context_menu.h" | 10 #include "chrome/browser/renderer_context_menu/render_view_context_menu.h" |
| 8 #include "chrome/browser/ui/apps/chrome_app_delegate.h" | 11 #include "chrome/browser/ui/apps/chrome_app_delegate.h" |
| 9 #include "components/renderer_context_menu/context_menu_delegate.h" | 12 #include "components/renderer_context_menu/context_menu_delegate.h" |
| 10 | 13 |
| 11 namespace extensions { | 14 namespace extensions { |
| 12 | 15 |
| 13 ChromeAppViewGuestDelegate::ChromeAppViewGuestDelegate() { | 16 ChromeAppViewGuestDelegate::ChromeAppViewGuestDelegate() { |
| 14 } | 17 } |
| 15 | 18 |
| 16 ChromeAppViewGuestDelegate::~ChromeAppViewGuestDelegate() { | 19 ChromeAppViewGuestDelegate::~ChromeAppViewGuestDelegate() { |
| 17 } | 20 } |
| 18 | 21 |
| 19 bool ChromeAppViewGuestDelegate::HandleContextMenu( | 22 bool ChromeAppViewGuestDelegate::HandleContextMenu( |
| 20 content::WebContents* web_contents, | 23 content::WebContents* web_contents, |
| 21 const content::ContextMenuParams& params) { | 24 const content::ContextMenuParams& params) { |
| 22 ContextMenuDelegate* menu_delegate = | 25 ContextMenuDelegate* menu_delegate = |
| 23 ContextMenuDelegate::FromWebContents(web_contents); | 26 ContextMenuDelegate::FromWebContents(web_contents); |
| 24 DCHECK(menu_delegate); | 27 DCHECK(menu_delegate); |
| 25 | 28 |
| 26 scoped_ptr<RenderViewContextMenuBase> menu = | 29 scoped_ptr<RenderViewContextMenuBase> menu = |
| 27 menu_delegate->BuildMenu(web_contents, params); | 30 menu_delegate->BuildMenu(web_contents, params); |
| 28 menu_delegate->ShowMenu(menu.Pass()); | 31 menu_delegate->ShowMenu(std::move(menu)); |
| 29 return true; | 32 return true; |
| 30 } | 33 } |
| 31 | 34 |
| 32 AppDelegate* ChromeAppViewGuestDelegate::CreateAppDelegate() { | 35 AppDelegate* ChromeAppViewGuestDelegate::CreateAppDelegate() { |
| 33 return new ChromeAppDelegate(make_scoped_ptr(new ScopedKeepAlive)); | 36 return new ChromeAppDelegate(make_scoped_ptr(new ScopedKeepAlive)); |
| 34 } | 37 } |
| 35 | 38 |
| 36 } // namespace extensions | 39 } // namespace extensions |
| OLD | NEW |