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

Unified Diff: apps/launcher.cc

Issue 2934513003: Changes in app.window and app.runtime to support lock screen note taking (Closed)
Patch Set: . 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
« no previous file with comments | « no previous file | chrome/browser/chromeos/lock_screen_apps/state_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: apps/launcher.cc
diff --git a/apps/launcher.cc b/apps/launcher.cc
index d1925112dd93844ee1b767a0fda026749912f2b1..3cf2ae0b61ab4ef9c7c44ecf12d5954c9166a78d 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,12 @@ void LaunchPlatformAppWithAction(
const extensions::Extension* app,
std::unique_ptr<app_runtime::ActionData> action_data,
const base::FilePath& file_path) {
+ CHECK(!action_data || !action_data->is_lock_screen_action ||
+ !*action_data->is_lock_screen_action ||
+ app->permissions_data()->HasAPIPermission(
+ extensions::APIPermission::kLockScreen))
+ << "Launching lock screen action handler requires lockScreen permission.";
+
scoped_refptr<PlatformAppPathLauncher> launcher =
new PlatformAppPathLauncher(context, app, file_path);
launcher->set_action_data(std::move(action_data));
« no previous file with comments | « no previous file | chrome/browser/chromeos/lock_screen_apps/state_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698