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