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