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

Side by Side Diff: chrome/browser/ui/apps/chrome_app_window_client.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/ui/apps/chrome_app_window_client.h" 5 #include "chrome/browser/ui/apps/chrome_app_window_client.h"
6 6
7 #include "base/memory/singleton.h" 7 #include "base/memory/singleton.h"
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 #include "chrome/browser/apps/scoped_keep_alive.h"
10 #include "chrome/browser/devtools/devtools_window.h" 9 #include "chrome/browser/devtools/devtools_window.h"
10 #include "chrome/browser/lifetime/scoped_keep_alive.h"
11 #include "chrome/common/extensions/features/feature_channel.h" 11 #include "chrome/common/extensions/features/feature_channel.h"
12 #include "components/version_info/version_info.h" 12 #include "components/version_info/version_info.h"
13 #include "content/public/browser/devtools_agent_host.h" 13 #include "content/public/browser/devtools_agent_host.h"
14 #include "extensions/browser/app_window/app_window.h" 14 #include "extensions/browser/app_window/app_window.h"
15 #include "extensions/common/extension.h" 15 #include "extensions/common/extension.h"
16 16
17 // TODO(jamescook): We probably shouldn't compile this class at all on Android. 17 // TODO(jamescook): We probably shouldn't compile this class at all on Android.
18 // See http://crbug.com/343612 18 // See http://crbug.com/343612
19 #if !defined(OS_ANDROID) 19 #if !defined(OS_ANDROID)
20 #include "chrome/browser/ui/apps/chrome_app_delegate.h" 20 #include "chrome/browser/ui/apps/chrome_app_delegate.h"
(...skipping 12 matching lines...) Expand all
33 base::LeakySingletonTraits<ChromeAppWindowClient>>::get(); 33 base::LeakySingletonTraits<ChromeAppWindowClient>>::get();
34 } 34 }
35 35
36 extensions::AppWindow* ChromeAppWindowClient::CreateAppWindow( 36 extensions::AppWindow* ChromeAppWindowClient::CreateAppWindow(
37 content::BrowserContext* context, 37 content::BrowserContext* context,
38 const extensions::Extension* extension) { 38 const extensions::Extension* extension) {
39 #if defined(OS_ANDROID) 39 #if defined(OS_ANDROID)
40 return NULL; 40 return NULL;
41 #else 41 #else
42 return new extensions::AppWindow( 42 return new extensions::AppWindow(
43 context, 43 context, new ChromeAppDelegate(
44 new ChromeAppDelegate(make_scoped_ptr(new ScopedKeepAlive)), 44 make_scoped_ptr(new ScopedKeepAlive("ChromeAppDelegate"))),
45 extension); 45 extension);
46 #endif 46 #endif
47 } 47 }
48 48
49 extensions::NativeAppWindow* ChromeAppWindowClient::CreateNativeAppWindow( 49 extensions::NativeAppWindow* ChromeAppWindowClient::CreateNativeAppWindow(
50 extensions::AppWindow* window, 50 extensions::AppWindow* window,
51 extensions::AppWindow::CreateParams* params) { 51 extensions::AppWindow::CreateParams* params) {
52 #if defined(OS_ANDROID) 52 #if defined(OS_ANDROID)
53 return NULL; 53 return NULL;
54 #else 54 #else
(...skipping 12 matching lines...) Expand all
67 DevToolsWindow::FindDevToolsWindow(agent.get()); 67 DevToolsWindow::FindDevToolsWindow(agent.get());
68 if (devtools_window) 68 if (devtools_window)
69 devtools_window->SetLoadCompletedCallback(callback); 69 devtools_window->SetLoadCompletedCallback(callback);
70 else 70 else
71 callback.Run(); 71 callback.Run();
72 } 72 }
73 73
74 bool ChromeAppWindowClient::IsCurrentChannelOlderThanDev() { 74 bool ChromeAppWindowClient::IsCurrentChannelOlderThanDev() {
75 return extensions::GetCurrentChannel() > version_info::Channel::DEV; 75 return extensions::GetCurrentChannel() > version_info::Channel::DEV;
76 } 76 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698