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/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 Loading... |
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 Loading... |
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 } |
OLD | NEW |