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

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: change strings 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
« no previous file with comments | « chrome/app/chromeos_strings.grdp ('k') | chrome/browser/resources/chromeos/keyboard_overlay_data.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..3fed9c8f64ba5e83e45e98d368985d3ff663b275 100644
--- a/chrome/browser/resources/chromeos/keyboard_overlay.js
+++ b/chrome/browser/resources/chromeos/keyboard_overlay.js
@@ -128,6 +128,19 @@ function getShortcutData() {
shortcutDataCache = keyboardOverlayData['shortcut'];
+ if (!isDisplayRotationEnabled()) {
+ // Rotate screen
+ delete shortcutDataCache['reload<>CTRL<>SHIFT'];
+ }
+ if (!isDisplayUIScalingEnabled()) {
+ // Zoom screen in
+ delete shortcutDataCache['+<>CTRL<>SHIFT'];
+ // Zoom screen out
+ delete shortcutDataCache['-<>CTRL<>SHIFT'];
+ // Reset screen zoom
+ delete shortcutDataCache['0<>CTRL<>SHIFT'];
+ }
+
// TODO(mazda): Clean this up and move these out to the data js.
var searchModifierAddShortcuts = {
'1<>SEARCH': 'keyboardOverlayF1',
@@ -603,8 +616,23 @@ function initLayout() {
* @return {boolean} Returns true if the device has a diamond key.
*/
function hasDiamondKey() {
- return (loadTimeData.getString('keyboardOverlayHasChromeOSDiamondKey') ==
- 'true');
+ return loadTimeData.getBoolean('keyboardOverlayHasChromeOSDiamondKey');
+}
+
+/**
+ * Returns true if display rotation feature is enabled.
+ * @return {boolean} True if display rotation feature is enabled.
+ */
+function isDisplayRotationEnabled() {
+ return loadTimeData.getBoolean('keyboardOverlayIsDisplayRotationEnabled');
+}
+
+/**
+ * Returns true if display scaling feature is enabled.
+ * @return {boolean} True if display scaling feature is enabled.
+ */
+function isDisplayUIScalingEnabled() {
+ return loadTimeData.getBoolean('keyboardOverlayIsDisplayUIScalingEnabled');
}
/**
« no previous file with comments | « chrome/app/chromeos_strings.grdp ('k') | chrome/browser/resources/chromeos/keyboard_overlay_data.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698