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

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

Issue 1376063005: Cleanup: Pull some browser keep alive functions into its own file. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 2 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/apps/scoped_keep_alive.h"
6 #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 #include "chrome/browser/lifetime/browser_keep_alive.h"
7 #include "chrome/browser/renderer_context_menu/render_view_context_menu.h" 7 #include "chrome/browser/renderer_context_menu/render_view_context_menu.h"
8 #include "chrome/browser/ui/apps/chrome_app_delegate.h" 8 #include "chrome/browser/ui/apps/chrome_app_delegate.h"
9 #include "components/renderer_context_menu/context_menu_delegate.h" 9 #include "components/renderer_context_menu/context_menu_delegate.h"
10 10
11 namespace extensions { 11 namespace extensions {
12 12
13 ChromeAppViewGuestDelegate::ChromeAppViewGuestDelegate() { 13 ChromeAppViewGuestDelegate::ChromeAppViewGuestDelegate() {
14 } 14 }
15 15
16 ChromeAppViewGuestDelegate::~ChromeAppViewGuestDelegate() { 16 ChromeAppViewGuestDelegate::~ChromeAppViewGuestDelegate() {
17 } 17 }
18 18
19 bool ChromeAppViewGuestDelegate::HandleContextMenu( 19 bool ChromeAppViewGuestDelegate::HandleContextMenu(
20 content::WebContents* web_contents, 20 content::WebContents* web_contents,
21 const content::ContextMenuParams& params) { 21 const content::ContextMenuParams& params) {
22 ContextMenuDelegate* menu_delegate = 22 ContextMenuDelegate* menu_delegate =
23 ContextMenuDelegate::FromWebContents(web_contents); 23 ContextMenuDelegate::FromWebContents(web_contents);
24 DCHECK(menu_delegate); 24 DCHECK(menu_delegate);
25 25
26 scoped_ptr<RenderViewContextMenuBase> menu = 26 scoped_ptr<RenderViewContextMenuBase> menu =
27 menu_delegate->BuildMenu(web_contents, params); 27 menu_delegate->BuildMenu(web_contents, params);
28 menu_delegate->ShowMenu(menu.Pass()); 28 menu_delegate->ShowMenu(menu.Pass());
29 return true; 29 return true;
30 } 30 }
31 31
32 AppDelegate* ChromeAppViewGuestDelegate::CreateAppDelegate() { 32 AppDelegate* ChromeAppViewGuestDelegate::CreateAppDelegate() {
33 return new ChromeAppDelegate(make_scoped_ptr(new ScopedKeepAlive)); 33 return new ChromeAppDelegate(
34 make_scoped_ptr(new browser_lifetime::ScopedKeepAlive));
34 } 35 }
35 36
36 } // namespace extensions 37 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/tabs/tabs_api.cc ('k') | chrome/browser/lifetime/application_lifetime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698