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