Commit 1be0222e authored by David Tseng's avatar David Tseng Committed by Commit Bot

Remove ChromeVox Classic toggle and scrub Next references from tutorial

Bug: 763249
Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation
Change-Id: Ide7da288c77645cd16391a6de869f91c6f89cad3
Reviewed-on: https://chromium-review.googlesource.com/671497
Commit-Queue: David Tseng <dtseng@chromium.org>
Reviewed-by: default avatarDominic Mazzoni <dmazzoni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#502946}
parent e527bc41
......@@ -140,7 +140,6 @@ chromevox_modules = [
"cvox2/background/live_regions.js",
"cvox2/background/media_automation_handler.js",
"cvox2/background/next_earcons.js",
"cvox2/background/notifications.js",
"cvox2/background/output.js",
"cvox2/background/panel.js",
"cvox2/background/panel_command.js",
......
......@@ -448,16 +448,6 @@
}
}
},
{
"command": "toggleChromeVoxVersion",
"sequence": {
"cvoxModifier": true,
"keys": {
"keyCode": [81],
"shitKey": [true]
}
}
},
{
"command": "toggleStickyMode",
"sequence": {
......
......@@ -19,7 +19,6 @@ goog.require('FindHandler');
goog.require('LiveRegions');
goog.require('MediaAutomationHandler');
goog.require('NextEarcons');
goog.require('Notifications');
goog.require('Output');
goog.require('Output.EventType');
goog.require('PanelCommand');
......@@ -276,7 +275,6 @@ Background.prototype = {
this.keyboardHandler_.onModeChanged(newMode, oldMode);
CommandHandler.onModeChanged(newMode, oldMode);
FindHandler.onModeChanged(newMode, oldMode);
Notifications.onModeChange(newMode, oldMode);
// The below logic handles transition between the classic engine
// (content script) and next engine (no content script) as well as
......@@ -333,45 +331,6 @@ Background.prototype = {
}
},
/**
* Toggles between force next and classic/compat modes.
* This toggle automatically handles deciding between classic/compat based on
* the start of the current range.
* @param {boolean=} opt_setValue Directly set to force next (true) or
* classic/compat (false).
* @return {boolean} True to announce current position.
*/
toggleNext: function(opt_setValue) {
var useNext;
if (opt_setValue !== undefined)
useNext = opt_setValue;
else
useNext = localStorage['useClassic'] == 'true';
if (useNext) {
chrome.metricsPrivate.recordUserAction(
'Accessibility.ChromeVox.ToggleNextOn');
} else {
chrome.metricsPrivate.recordUserAction(
'Accessibility.ChromeVox.ToggleNextOff');
}
localStorage['useClassic'] = !useNext;
if (useNext)
this.setCurrentRangeToFocus_();
else
this.setCurrentRange(null);
var announce =
Msgs.getMsg(useNext ? 'switch_to_next' : 'switch_to_classic');
cvox.ChromeVox.tts.speak(
announce, cvox.QueueMode.FLUSH, {doNotInterrupt: true});
// If the new mode is Classic, return false now so we don't announce
// anything more.
return useNext;
},
/**
* @override
*/
......
......@@ -465,28 +465,6 @@ TEST_F('BackgroundTest', 'EarconsForControls', function() {
}.bind(this));
});
TEST_F('BackgroundTest', 'ToggleChromeVoxVersion', function() {
var mockFeedback = this.createMockFeedback();
this.runWithLoadedTree(this.linksAndHeadingsDoc, function() {
var gotCmd = CommandHandler.onCommand;
// The command came from the background keyboard handler.
var togglerFromBackground = gotCmd.bind(gotCmd, 'toggleChromeVoxVersion');
// The command came from a content script.
var togglerFromContent = gotCmd.bind(gotCmd, 'toggleChromeVoxVersion',
true);
mockFeedback.call(togglerFromBackground)
.expectSpeech('Switched to Classic ChromeVox')
.call(togglerFromContent)
.expectSpeech('Switched to ChromeVox Next')
.call(togglerFromBackground)
.expectSpeech('Switched to Classic ChromeVox');
mockFeedback.replay();
});
});
SYNC_TEST_F('BackgroundTest', 'GlobsToRegExp', function() {
assertEquals('/^()$/', Background.globsToRegExp_([]).toString());
assertEquals(
......@@ -791,7 +769,7 @@ TEST_F('BackgroundTest', 'ForwardObjectNavigationThroughIframes', function() {
mockFeedback.call(doCmd('nextObject'))
.expectSpeech('After', 'Button');
mockFeedback.call(doCmd('previousObject'))
.expectSpeech('Inside', 'Heading 1');
.expectSpeech('Heading 1', 'Inside');
mockFeedback.call(doCmd('previousObject'))
.expectSpeech('Inside', 'Button');
mockFeedback.call(doCmd('previousObject'))
......
......@@ -202,14 +202,6 @@ CommandHandler.onCommand = function(command) {
localStorage[brailleTableType]);
new Output().format(output).go();
return false;
case 'toggleChromeVoxVersion':
if (!ChromeVoxState.instance.toggleNext())
return false;
if (ChromeVoxState.instance.currentRange) {
ChromeVoxState.instance.navigateToRange(
ChromeVoxState.instance.currentRange);
}
break;
case 'help':
(new PanelCommand(PanelCommandType.TUTORIAL)).send();
return false;
......
// Copyright 2016 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.
/**
* @fileoverview Provides notification support for ChromeVox.
*/
goog.provide('Notifications');
goog.require('PanelCommand');
/**
* ChromeVox update notification.
* @constructor
*/
function UpdateNotification() {
this.data = {};
this.data.type = 'basic';
this.data.iconUrl = '/images/chromevox-16.png';
this.data.title = Msgs.getMsg('update_title');
this.data.message = Msgs.getMsg('update_message_next');
}
UpdateNotification.prototype = {
/** @return {boolean} */
shouldShow: function() {
return !localStorage['notifications_update_notification_shown'] &&
chrome.runtime.getManifest().version >= '53' &&
cvox.ChromeVox.isChromeOS;
},
/** Shows the notification. */
show: function() {
if (!this.shouldShow())
return;
chrome.notifications.create('update', this.data);
chrome.notifications.onClicked.addListener(this.onClicked);
chrome.notifications.onClosed.addListener(this.onClosed);
},
/**
* Handles the chrome.notifications event.
* @param {string} notificationId
*/
onClicked: function(notificationId) {
(new PanelCommand(PanelCommandType.TUTORIAL)).send();
},
/**
* Handles the chrome.notifications event.
* @param {string} id
*/
onClosed: function(id) {
localStorage['notifications_update_notification_shown'] = true;
},
/**
* Removes all listeners added by this object.
*/
removeAllListeners: function() {
chrome.notifications.onClicked.removeListener(this.onClicked);
chrome.notifications.onClosed.removeListener(this.onClosed);
}
};
/**
* Set after an update is shown.
* @type {UpdateNotification}
*/
Notifications.currentUpdate;
/**
* Runs notifications that should be shown for mode changes.
* @param {ChromeVoxMode} newMode
* @param {?ChromeVoxMode} oldMode Can be null at startup when no range was
* previously set.
*/
Notifications.onModeChange = function(newMode, oldMode) {
// Only run on background page.
if (document.location.href.indexOf('background.html') == -1)
return;
if (newMode !== ChromeVoxMode.FORCE_NEXT)
return;
// Reset the notifications only when mode changes after startup. This prevents
// us from making notification announcements every time on startup.
if (oldMode)
Notifications.reset();
Notifications.currentUpdate = new UpdateNotification();
Notifications.currentUpdate.show();
};
/**
* Resets to a clean state. Future events will trigger update notifications.
*/
Notifications.reset = function() {
if (Notifications.currentUpdate)
Notifications.currentUpdate.removeAllListeners();
delete localStorage['notifications_update_notification_shown'];
};
......@@ -2530,25 +2530,9 @@
<message desc="Title displayed in the panel for the menuitem to report an issue." name="IDS_CHROMEVOX_PANEL_MENU_ITEM_REPORT_ISSUE">
Report an issue
</message>
<message desc="Title of a notification that ChromeVox has been updated." name="IDS_CHROMEVOX_UPDATE_TITLE">
ChromeVox Updated
</message>
<message desc="Message text for a notification that ChromeVox has been updated for a new experience." name="IDS_CHROMEVOX_UPDATE_MESSAGE_NEXT">
Press ChromeVox o, n to learn more about ChromeVox Next.
</message>
<message desc="Options page description for the command to show ChromeVox's update page." name="IDS_CHROMEVOX_SHOW_NEXT_UPDATE_DESCRIPTION">
Show update notes
</message>
<message desc="Checkbox label for toggling on/off ChromeVox's new beta experience." name="IDS_CHROMEVOX_OPTIONS_USE_NEXT_LABEL">
Use ChromeVox Next (beta)
</message>
<message desc="Spoken when switching to the classic ChromeVox experience." name="IDS_CHROMEVOX_SWITCH_TO_CLASSIC">
Switched to Classic ChromeVox
</message>
<message desc="Spoken when switching to the new beta experience." name="IDS_CHROMEVOX_SWITCH_TO_NEXT">
Switched to ChromeVox Next
</message>
<message desc="Description of button that closes the ChromeVox Tutorial" name="IDS_CHROMEVOX_CLOSE_TUTORIAL">
Close ChromeVox Tutorial
</message>
......@@ -2558,11 +2542,11 @@
<message desc="Button that goes to the next page in the ChromeVox Tutorial" name="IDS_CHROMEVOX_TUTORIAL_NEXT">
Next
</message>
<message desc="Heading that welcomes users to the ChromeVox Next tutorial" name="IDS_CHROMEVOX_TUTORIAL_WELCOME_HEADING">
Welcome to ChromeVox Next!
<message desc="Heading that welcomes users to the ChromeVox tutorial" name="IDS_CHROMEVOX_TUTORIAL_WELCOME_HEADING">
Welcome to ChromeVox!
</message>
<message desc="Introductory text for the 'ChromeVox Next' tutorial" name="IDS_CHROMEVOX_TUTORIAL_WELCOME_TEXT">
Are you using ChromeVox Next spoken feedback for the first time? This quick tutorial explains the essentials for getting started with ChromeVox Next.
<message desc="Introductory text for the 'ChromeVox' tutorial" name="IDS_CHROMEVOX_TUTORIAL_WELCOME_TEXT">
Are you using ChromeVox spoken feedback for the first time? This quick tutorial explains the essentials for getting started with ChromeVox.
</message>
<message desc="Text that tells users to press the enter key to move to the next page or backspace to move to the previous page in the tutorial" name="IDS_CHROMEVOX_TUTORIAL_ENTER_TO_ADVANCE">
To advance, press enter; to go back, press backspace.
......@@ -2580,7 +2564,7 @@
The ChromeVox modifier key
</message>
<message desc="Text explaining that the Search key on the keyboard will be held down for most ChromeVox shortcuts" name="IDS_CHROMEVOX_TUTORIAL_MODIFIER">
In ChromeVox Next, the Search key is the modifier key. Most ChromeVox shortcuts start with the Search key. You’ll also use the arrow keys for navigation.
In ChromeVox, the Search key is the modifier key. Most ChromeVox shortcuts start with the Search key. You’ll also use the arrow keys for navigation.
</message>
<message desc="Text explaining where to find the Search key on a Chromebook keyboard" name="IDS_CHROMEVOX_TUTORIAL_CHROMEBOOK_SEARCH">
On the Chromebook, the Search key is immediately above the left Shift key.
......@@ -2634,7 +2618,7 @@ To open the Chrome browser menu, press Alt+F.
Learn More
</message>
<message desc="Part of the ChromeVox tutorial, explaining that this is the end of the tutorial and that there are links to more information." name="IDS_CHROMEVOX_TUTORIAL_LEARN_MORE">
Congratulations! You’ve learned the essentials to use ChromeVox Next (beta) successfully. Remember that you can open the ChromeVox command menu at any time by pressing Search+Period. To learn even more about ChromeVox and Chrome OS, visit the following articles.
Congratulations! You’ve learned the essentials to use ChromeVox successfully. Remember that you can open the ChromeVox command menu at any time by pressing Search+Period. To learn even more about ChromeVox and Chrome OS, visit the following articles.
If you're done with the tutorial, use ChromeVox to navigate to the Close button and click it.
</message>
<message desc="Part of the ChromeVox update notes for m56, title." name="IDS_CHROMEVOX_UPDATE_56_TITLE">
......@@ -2655,8 +2639,8 @@ If you're done with the tutorial, use ChromeVox to navigate to the Close button
<message desc="Part of the ChromeVox update notes for m56, closing paragraph." name="IDS_CHROMEVOX_UPDATE_56_OUTTRO">
We're excited to hear from you on this new experience. Send us feedback directly by pressing Search+a, then i. Press the next button to continue onto the tutorial to learn everything you need to get started.
</message>
<message desc="Title of an article on the command reference for 'ChromeVox Next'" name="IDS_CHROMEVOX_NEXT_COMMAND_REFERENCE">
ChromeVox Next Command Reference
<message desc="Title of an article on the command reference for 'ChromeVox'" name="IDS_CHROMEVOX_NEXT_COMMAND_REFERENCE">
ChromeVox Command Reference
</message>
<message desc="Title of an article on keyboard shortcuts for Chromebooks" name="IDS_CHROMEVOX_CHROME_KEYBOARD_SHORTCUTS">
Chromebook keyboard shortcuts
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment