Index: chrome/browser/ui/apps/chrome_app_window_client.cc |
diff --git a/chrome/browser/ui/apps/chrome_app_window_client.cc b/chrome/browser/ui/apps/chrome_app_window_client.cc |
index 3349e24d5a93777cfb2b33eefe0d48f43b588603..d1ed5ddcd9f2dab3dd6a4bfc7403a76700e5aac2 100644 |
--- a/chrome/browser/ui/apps/chrome_app_window_client.cc |
+++ b/chrome/browser/ui/apps/chrome_app_window_client.cc |
@@ -4,6 +4,9 @@ |
#include "chrome/browser/ui/apps/chrome_app_window_client.h" |
+#include <memory> |
+ |
+#include "base/memory/ptr_util.h" |
#include "base/memory/singleton.h" |
#include "build/build_config.h" |
#include "chrome/browser/devtools/devtools_window.h" |
@@ -13,6 +16,10 @@ |
#include "extensions/common/extension.h" |
#include "extensions/common/features/feature_channel.h" |
+#if defined(OS_CHROMEOS) |
+#include "chrome/browser/chromeos/lock_screen_apps/state_controller.h" |
+#endif |
+ |
// TODO(jamescook): We probably shouldn't compile this class at all on Android. |
// See http://crbug.com/343612 |
#if !defined(OS_ANDROID) |
@@ -43,11 +50,39 @@ extensions::AppWindow* ChromeAppWindowClient::CreateAppWindow( |
#endif |
} |
+extensions::AppWindow* |
+ChromeAppWindowClient::CreateAppWindowForLockScreenAction( |
+ content::BrowserContext* context, |
+ const extensions::Extension* extension, |
+ extensions::api::app_runtime::ActionType action) { |
+#if defined(OS_CHROMEOS) |
+ if (!lock_screen_apps::StateController::IsEnabled()) |
+ return nullptr; |
+ |
+ if (!lock_screen_apps::StateController::Get()->CanCreateAppWindowForAction( |
+ context, extension, action)) { |
+ return nullptr; |
+ } |
+ |
+ extensions::AppWindow* window = CreateAppWindow(context, extension); |
+ |
+ if (!lock_screen_apps::StateController::Get()->RegisterAppWindowForAction( |
+ window, action)) { |
+ NOTREACHED() << "Failed to register app window for lock screen action"; |
+ return nullptr; |
+ } |
+ |
+ return window; |
+#else |
+ return nullptr; |
+#endif |
+} |
+ |
extensions::NativeAppWindow* ChromeAppWindowClient::CreateNativeAppWindow( |
extensions::AppWindow* window, |
extensions::AppWindow::CreateParams* params) { |
#if defined(OS_ANDROID) |
- return NULL; |
+ return nullptr; |
#else |
return CreateNativeAppWindowImpl(window, *params); |
#endif |