Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(57)

Side by Side Diff: chrome/browser/guest_view/app_view/chrome_app_view_guest_delegate.cc

Issue 1708343002: Add ScopedKeepAlive to c/b/lifetime (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use singleton instead of browserprocess Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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" 9 #include "chrome/browser/lifetime/scoped_keep_alive.h"
10 #include "chrome/browser/renderer_context_menu/render_view_context_menu.h" 10 #include "chrome/browser/renderer_context_menu/render_view_context_menu.h"
11 #include "chrome/browser/ui/apps/chrome_app_delegate.h" 11 #include "chrome/browser/ui/apps/chrome_app_delegate.h"
12 #include "components/renderer_context_menu/context_menu_delegate.h" 12 #include "components/renderer_context_menu/context_menu_delegate.h"
13 13
14 namespace extensions { 14 namespace extensions {
15 15
16 ChromeAppViewGuestDelegate::ChromeAppViewGuestDelegate() { 16 ChromeAppViewGuestDelegate::ChromeAppViewGuestDelegate() {
17 } 17 }
18 18
19 ChromeAppViewGuestDelegate::~ChromeAppViewGuestDelegate() { 19 ChromeAppViewGuestDelegate::~ChromeAppViewGuestDelegate() {
20 } 20 }
21 21
22 bool ChromeAppViewGuestDelegate::HandleContextMenu( 22 bool ChromeAppViewGuestDelegate::HandleContextMenu(
23 content::WebContents* web_contents, 23 content::WebContents* web_contents,
24 const content::ContextMenuParams& params) { 24 const content::ContextMenuParams& params) {
25 ContextMenuDelegate* menu_delegate = 25 ContextMenuDelegate* menu_delegate =
26 ContextMenuDelegate::FromWebContents(web_contents); 26 ContextMenuDelegate::FromWebContents(web_contents);
27 DCHECK(menu_delegate); 27 DCHECK(menu_delegate);
28 28
29 scoped_ptr<RenderViewContextMenuBase> menu = 29 scoped_ptr<RenderViewContextMenuBase> menu =
30 menu_delegate->BuildMenu(web_contents, params); 30 menu_delegate->BuildMenu(web_contents, params);
31 menu_delegate->ShowMenu(std::move(menu)); 31 menu_delegate->ShowMenu(std::move(menu));
32 return true; 32 return true;
33 } 33 }
34 34
35 AppDelegate* ChromeAppViewGuestDelegate::CreateAppDelegate() { 35 AppDelegate* ChromeAppViewGuestDelegate::CreateAppDelegate() {
36 return new ChromeAppDelegate(make_scoped_ptr(new ScopedKeepAlive)); 36 return new ChromeAppDelegate(
37 make_scoped_ptr(new ScopedKeepAlive("ChromeAppDelegate")));
37 } 38 }
38 39
39 } // namespace extensions 40 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698