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

Unified Diff: apps/launcher.cc

Issue 2934513003: Changes in app.window and app.runtime to support lock screen note taking (Closed)
Patch Set: split out browsertests Created 3 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: apps/launcher.cc
diff --git a/apps/launcher.cc b/apps/launcher.cc
index d1925112dd93844ee1b767a0fda026749912f2b1..03e394bb35f1348e9526a2d2cf4882478f8aa083 100644
--- a/apps/launcher.cc
+++ b/apps/launcher.cc
@@ -37,6 +37,8 @@
#include "extensions/common/api/app_runtime.h"
#include "extensions/common/extension.h"
#include "extensions/common/manifest_handlers/kiosk_mode_info.h"
+#include "extensions/common/permissions/api_permission.h"
+#include "extensions/common/permissions/permissions_data.h"
#include "net/base/filename_util.h"
#include "url/gurl.h"
@@ -434,6 +436,14 @@ void LaunchPlatformAppWithAction(
const extensions::Extension* app,
std::unique_ptr<app_runtime::ActionData> action_data,
const base::FilePath& file_path) {
+ if (action_data && action_data->is_lock_screen_action &&
+ *action_data->is_lock_screen_action &&
+ !app->permissions_data()->HasAPIPermission(
+ extensions::APIPermission::kLockScreen)) {
+ NOTREACHED() << "Launching lock screen action handler requires lockScreen "
+ << "permission.";
+ return;
+ }
scoped_refptr<PlatformAppPathLauncher> launcher =
new PlatformAppPathLauncher(context, app, file_path);
launcher->set_action_data(std::move(action_data));

Powered by Google App Engine
This is Rietveld 408576698