forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ARC++ resize lock setting to Chrome OS settings
ARC++ apps in resize lock mode have restrictions on various features such as window resizing (resize lock), and users can disable these restrictions via Chrome OS settings. This CL adds a toggle to the Chrome OS settings. This value is in sync via app service with the value stored in ArcAppListPref, which is the source of truth. This setting is hidden for apps that are not subject to resize lock mode. BUG=b:181614099 BUG=b:180252634 BUG=b:180252639 TEST=The setting appears and togglable for resize-locked apps Change-Id: I126c838144a1eb5089abf9256fcb4966b2611d4c Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2734380 Commit-Queue: Kazuki Takise <takise@chromium.org> Auto-Submit: Kazuki Takise <takise@chromium.org> Reviewed-by: Jeevan Shikaram <jshikaram@chromium.org> Reviewed-by: Ken Rockot <rockot@google.com> Reviewed-by: James Cook <jamescook@chromium.org> Reviewed-by: Dominick Ng <dominickn@chromium.org> Cr-Commit-Position: refs/heads/master@{#894057}
- Loading branch information
Showing
22 changed files
with
297 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
chrome/app/app_management_strings_grdp/IDS_APP_MANAGEMENT_PRESET_WINDOW_SIZES.png.sha1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
32432d4b79aa8ed7d48e20e0a796fb722b89a737 |
1 change: 1 addition & 0 deletions
1
chrome/app/app_management_strings_grdp/IDS_APP_MANAGEMENT_PRESET_WINDOW_SIZES_TEXT.png.sha1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
32432d4b79aa8ed7d48e20e0a796fb722b89a737 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
...rowser/resources/settings/chromeos/os_apps_page/app_management_page/resize_lock_item.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<link rel="import" href="chrome://resources/html/polymer.html"> | ||
<link rel="import" href="chrome://resources/html/assert.html"> | ||
<link rel="import" href="toggle_row.html"> | ||
<link rel="import" href="util.html"> | ||
<link rel="import" href="browser_proxy.html"> | ||
<link rel="import" href="constants.html"> | ||
<link rel="import" href="../../metrics_recorder.html"> | ||
|
||
<dom-module id="app-management-resize-lock-item"> | ||
<template> | ||
<style> | ||
:host { | ||
cursor: pointer; | ||
} | ||
</style> | ||
<app-management-toggle-row | ||
id="toggle-row" | ||
label="$i18n{appManagementPresetWindowSizesLabel}" | ||
value="[[getValue_(app)]]" | ||
description="$i18n{appManagementPresetWindowSizesText}"> | ||
</app-management-toggle-row> | ||
</template> | ||
<script src="resize_lock_item.js"></script> | ||
</dom-module> |
73 changes: 73 additions & 0 deletions
73
.../browser/resources/settings/chromeos/os_apps_page/app_management_page/resize_lock_item.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
// Copyright 2021 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
Polymer({ | ||
is: 'app-management-resize-lock-item', | ||
|
||
properties: { | ||
/** | ||
* @type {App} | ||
*/ | ||
app: Object, | ||
|
||
/** | ||
* @type {boolean} | ||
*/ | ||
hidden: { | ||
type: Boolean, | ||
computed: 'isHidden_(app)', | ||
reflectToAttribute: true, | ||
}, | ||
}, | ||
|
||
listeners: { | ||
click: 'onClick_', | ||
change: 'toggleSetting_', | ||
}, | ||
|
||
/** | ||
* @param {App} app | ||
* @returns {boolean} true if the app is resize locked. | ||
* @private | ||
*/ | ||
getValue_(app) { | ||
if (app === undefined) { | ||
return false; | ||
} | ||
assert(app); | ||
return app.resizeLocked; | ||
}, | ||
|
||
/** | ||
* @param {App} app | ||
* @returns {boolean} true if resize lock setting is hidden. | ||
*/ | ||
isHidden_(app) { | ||
if (app === undefined) { | ||
return true; | ||
} | ||
assert(app); | ||
return app.hideResizeLocked; | ||
}, | ||
|
||
toggleSetting_() { | ||
const newState = !this.app.resizeLocked; | ||
assert(newState === this.$['toggle-row'].isChecked()); | ||
app_management.BrowserProxy.getInstance().handler.setResizeLocked( | ||
this.app.id, | ||
newState, | ||
); | ||
settings.recordSettingChange(); | ||
const userAction = newState ? AppManagementUserAction.ResizeLockTurnedOn : | ||
AppManagementUserAction.ResizeLockTurnedOff; | ||
app_management.util.recordAppManagementUserAction( | ||
this.app.type, userAction); | ||
}, | ||
|
||
/** | ||
* @private | ||
*/ | ||
onClick_() { | ||
this.$['toggle-row'].click(); | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.