| Index: chrome/browser/extensions/api/app_current_window_internal/app_current_window_internal_api.cc
|
| diff --git a/chrome/browser/extensions/api/app_current_window_internal/app_current_window_internal_api.cc b/chrome/browser/extensions/api/app_current_window_internal/app_current_window_internal_api.cc
|
| index 7cde5b5c20cdc57c1bea63b380a0423e7b4f20e5..31bf4200d40add42129f075dd0de87eee71099c8 100644
|
| --- a/chrome/browser/extensions/api/app_current_window_internal/app_current_window_internal_api.cc
|
| +++ b/chrome/browser/extensions/api/app_current_window_internal/app_current_window_internal_api.cc
|
| @@ -28,6 +28,8 @@ namespace SetIcon = app_current_window_internal::SetIcon;
|
| namespace SetBadgeIcon = app_current_window_internal::SetBadgeIcon;
|
| namespace SetShape = app_current_window_internal::SetShape;
|
| namespace SetAlwaysOnTop = app_current_window_internal::SetAlwaysOnTop;
|
| +namespace SetInterceptAllKeys =
|
| + app_current_window_internal::SetInterceptAllKeys;
|
|
|
| using apps::AppWindow;
|
| using app_current_window_internal::Bounds;
|
| @@ -52,6 +54,11 @@ const char kRequiresFramelessWindow[] =
|
| const char kAlwaysOnTopPermission[] =
|
| "The \"app.window.alwaysOnTop\" permission is required.";
|
|
|
| +const char kInterceptAllKeysPermission[] = "app.window.interceptAllKeys";
|
| +
|
| +const char kInterceptAllKeysPermissionError[] =
|
| + "The \"app.window.interceptAllKeys\" permission is required.";
|
| +
|
| const char kInvalidParameters[] = "Invalid parameters.";
|
|
|
| const int kUnboundedSize = apps::SizeConstraints::kUnboundedSize;
|
| @@ -399,4 +406,19 @@ bool AppCurrentWindowInternalSetAlwaysOnTopFunction::RunWithWindow(
|
| return true;
|
| }
|
|
|
| +bool AppCurrentWindowInternalSetInterceptAllKeysFunction::RunWithWindow(
|
| + AppWindow* window) {
|
| + if (!extension()->permissions_data()->HasAPIPermission(
|
| + kInterceptAllKeysPermission)) {
|
| + error_ = kInterceptAllKeysPermissionError;
|
| + return false;
|
| + }
|
| +
|
| + scoped_ptr<SetInterceptAllKeys::Params> params(
|
| + SetInterceptAllKeys::Params::Create(*args_));
|
| + CHECK(params.get());
|
| + window->SetInterceptAllKeys(params->want_all_keys);
|
| + return true;
|
| +}
|
| +
|
| } // namespace extensions
|
|
|