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

Unified Diff: chrome/browser/resources/chromeos/keyboard_overlay.js

Issue 12617019: Add display scaling and rotation shortcuts to keyboard overlay. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 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: chrome/browser/resources/chromeos/keyboard_overlay.js
diff --git a/chrome/browser/resources/chromeos/keyboard_overlay.js b/chrome/browser/resources/chromeos/keyboard_overlay.js
index 4d68ac1b44acac56fb6b4882024817151f9ffecf..80be8e386cf45ef613ff0dc4ba0beb3ffd695f6b 100644
--- a/chrome/browser/resources/chromeos/keyboard_overlay.js
+++ b/chrome/browser/resources/chromeos/keyboard_overlay.js
@@ -128,6 +128,17 @@ function getShortcutData() {
shortcutDataCache = keyboardOverlayData['shortcut'];
+ if (!isDisplayRotationEnabled()) {
+ // Rotate screen
+ delete shortcutDataCache['reload<>CTRL<>SHIFT'];
+ }
+ if (!isDisplayUIScalingEnabled()) {
+ // Scale up UI
+ delete shortcutDataCache['back<>CTRL<>SHIFT'];
+ // Scale down UI
+ delete shortcutDataCache['forward<>CTRL<>SHIFT'];
+ }
+
// TODO(mazda): Clean this up and move these out to the data js.
var searchModifierAddShortcuts = {
'1<>SEARCH': 'keyboardOverlayF1',
@@ -608,6 +619,24 @@ function hasDiamondKey() {
}
/**
+ * Returns true if display rotation feature is enabled.
+ * @return {boolean} True if display rotation feature is enabled.
+ */
+function isDisplayRotationEnabled() {
+ return (loadTimeData.getString('keyboardOverlayIsDisplayRotationEnabled') ==
+ 'true');
+}
+
+/**
+ * Returns true if display scaling feature is enabled.
+ * @return {boolean} True if display scaling feature is enabled.
+ */
+function isDisplayUIScalingEnabled() {
+ return (loadTimeData.getString('keyboardOverlayIsDisplayUIScalingEnabled') ==
+ 'true');
+}
+
+/**
* Initializes the layout and the key labels for the keyboard that has a diamond
* key.
*/

Powered by Google App Engine
This is Rietveld 408576698