| Index: extensions/browser/api/app_current_window_internal/app_current_window_internal_api.cc
|
| diff --git a/extensions/browser/api/app_current_window_internal/app_current_window_internal_api.cc b/extensions/browser/api/app_current_window_internal/app_current_window_internal_api.cc
|
| index 29cf618a1f77fc114cc4145e36674b4a86fe1ef6..3e3de5d058eb644eba3db535f28146ded7e7c737 100644
|
| --- a/extensions/browser/api/app_current_window_internal/app_current_window_internal_api.cc
|
| +++ b/extensions/browser/api/app_current_window_internal/app_current_window_internal_api.cc
|
| @@ -28,7 +28,8 @@ namespace SetShape = app_current_window_internal::SetShape;
|
| namespace SetAlwaysOnTop = app_current_window_internal::SetAlwaysOnTop;
|
| namespace SetVisibleOnAllWorkspaces =
|
| app_current_window_internal::SetVisibleOnAllWorkspaces;
|
| -
|
| +namespace SetInterceptAllKeys =
|
| + app_current_window_internal::SetInterceptAllKeys;
|
| using app_current_window_internal::Bounds;
|
| using app_current_window_internal::Region;
|
| using app_current_window_internal::RegionRect;
|
| @@ -51,6 +52,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 = SizeConstraints::kUnboundedSize;
|
| @@ -412,4 +418,19 @@ bool AppCurrentWindowInternalSetVisibleOnAllWorkspacesFunction::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
|
|
|