Commit 598e76c2 authored by David Tseng's avatar David Tseng Committed by Commit Bot

Partial revert of add a Google tts engine settings page

Original change:
Initial Google tts engine settings page

- hooks up a message to retrieve display voice name and language (for *only* Google tts engine)
- adds the initial page UI (under UI review)
- adds string resources (under review)

Bug: 831286

TBR=dtseng@chromium.org,hcarmona@chromium.org,katie@chromium.org

Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation
Change-Id: I1bb2780758992ed9f8e240ed28a8176201d06f05
Reviewed-on: https://chromium-review.googlesource.com/1028766
Commit-Queue: David Tseng <dtseng@chromium.org>
Reviewed-by: default avatarDavid Tseng <dtseng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#553811}
parent c5e364a4
...@@ -173,18 +173,6 @@ ...@@ -173,18 +173,6 @@
<message name="IDS_SETTINGS_TTS_LINK_DESCRIPTION" desc="Description of link to manage text-to-speech settings"> <message name="IDS_SETTINGS_TTS_LINK_DESCRIPTION" desc="Description of link to manage text-to-speech settings">
Select and customize text-to-speech voices Select and customize text-to-speech voices
</message> </message>
<message name="IDS_SETTINGS_MANAGE_GOOGLE_TTS_ENGINE_SETTINGS" desc="Link to manage Google text-to-speech engine settings">
Manage Google text-to-speech
</message>
<message name="IDS_SETTINGS_GOOGLE_TTS_ENGINE_LINK_DESCRIPTION" desc="Description of link to manage Google text-to-speech engine settings">
Add or remove Google text-to-speech voices
</message>
<message name="IDS_SETTINGS_GOOGLE_TTS_ENGINE_TITLE" desc="Title of the Google text-to-speech engine settings page">
Google Text-To-Speech Settings
</message>
<message name="IDS_SETTINGS_ENABLE_TTS_VOICE_LABEL" desc="Title of the checkbox which enables or disables a text-to-speech voice.">
Enable voice
</message>
<message name="IDS_SETTINGS_LARGE_MOUSE_CURSOR_LABEL" desc="Label for checkbox which enables showing a larger mouse cursor than normal."> <message name="IDS_SETTINGS_LARGE_MOUSE_CURSOR_LABEL" desc="Label for checkbox which enables showing a larger mouse cursor than normal.">
Show large mouse cursor Show large mouse cursor
</message> </message>
......
...@@ -56,15 +56,6 @@ ...@@ -56,15 +56,6 @@
</settings-tts-subpage> </settings-tts-subpage>
</settings-subpage> </settings-subpage>
</template> </template>
<template is="dom-if"
route-path="/manageAccessibility/tts/googleTtsEngine">
<settings-subpage
associated-control="[[$$('#subpage-trigger')]]"
page-title="$i18n{googleTextToSpeechSettings}">
<settings-google-tts-engine-subpage>
</settings-google-tts-engine-subpage>
</settings-subpage>
</template>
</template> </template>
</settings-animated-pages> </settings-animated-pages>
</if> </if>
......
<link rel="import" href="chrome://resources/html/polymer.html">
<link rel="import" href="../controls/settings_slider.html">
<link rel="import" href="../i18n_setup.html">
<link rel="import" href="../settings_shared_css.html">
<link rel="import" href="../settings_vars_css.html">
<dom-module id="settings-google-tts-engine-subpage">
<template>
<style include="settings-shared">
h2 {
-webkit-padding-start: var(--settings-box-row-padding);
}
.settings-box {
-webkit-margin-end: var(--settings-box-row-padding);
-webkit-margin-start: var(--settings-box-row-indent);
-webkit-padding-end: 0;
-webkit-padding-start: 0;
}
</style>
<div class="settings-box block first">
</div>
<template is="dom-repeat" items="[[voiceList_]]">
<h2>[[item.language]]</h2>
<div class="list-frame vertical-list">
<div class="list-item">
<div>
<paper-checkbox hidden="[[item.builtIn]]">
$i18n{enableTtsVoiceLabel}
</paper-checkbox>
<span>[[item.name]]</span>
</div>
</div>
</div>
</template>
</template>
<script src="google_tts_engine_subpage.js"></script>
</dom-module>
// Copyright 2018 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 'tts-subpage' is the collapsible section containing
* text-to-speech settings.
*/
Polymer({
is: 'settings-google-tts-engine-subpage',
behaviors: [I18nBehavior, WebUIListenerBehavior],
properties: {
/**
* List of tts voices.
* @private {!Array<
* !{language: string,
* name: string
* }>}
*/
voiceList_: Array
},
/** @override */
ready: function() {
this.addWebUIListener(
'google-voice-data-updated', this.onVoicesUpdated_.bind(this));
chrome.send('getGoogleTtsVoiceData');
},
/** @private */
onVoicesUpdated_: function(voices) {
this.voiceList_ = voices;
},
});
<link rel="import" href="chrome://resources/html/polymer.html"> <link rel="import" href="chrome://resources/html/polymer.html">
<link rel="import" href="google_tts_engine_subpage.html">
<link rel="import" href="../controls/settings_slider.html"> <link rel="import" href="../controls/settings_slider.html">
<link rel="import" href="../i18n_setup.html"> <link rel="import" href="../i18n_setup.html">
<link rel="import" href="../settings_shared_css.html"> <link rel="import" href="../settings_shared_css.html">
...@@ -76,21 +75,6 @@ ...@@ -76,21 +75,6 @@
<div class="settings-box block first"> <div class="settings-box block first">
<a href="">$i18n{textToSpeechInstallEngines}</a> <a href="">$i18n{textToSpeechInstallEngines}</a>
</div> </div>
<div class="settings-box two-line"
on-click="onManageGoogleTtsEngineSettingsClick_"
actionable>
<div class="start" id="appearanceSettingsPrimary">
$i18n{manageGoogleTtsEngineSettings}
<div class="secondary" id="appearanceSettingsSecondary">
$i18n{googleTtsEngineSettingsLinkDescription}
</div>
</div>
<paper-icon-button-light class="subpage-arrow">
<button aria-labelledby="appearanceSettingsPrimary"
aria-describedby="appearanceSettingsSecondary"></button>
</paper-icon-button-light>
</div>
</template> </template>
<script src="tts_subpage.js"></script> <script src="tts_subpage.js"></script>
</dom-module> </dom-module>
...@@ -20,11 +20,6 @@ Polymer({ ...@@ -20,11 +20,6 @@ Polymer({
}, },
}, },
/** @private */
onManageGoogleTtsEngineSettingsClick_: function() {
settings.navigateTo(settings.routes.MANAGE_GOOGLE_TTS_ENGINE_SETTINGS);
},
/** @private */ /** @private */
onPreviewTtsClick_: function() { onPreviewTtsClick_: function() {
let utter = new window.SpeechSynthesisUtterance(); let utter = new window.SpeechSynthesisUtterance();
......
...@@ -45,7 +45,6 @@ ...@@ -45,7 +45,6 @@
* LANGUAGES: (undefined|!settings.Route), * LANGUAGES: (undefined|!settings.Route),
* LOCK_SCREEN: (undefined|!settings.Route), * LOCK_SCREEN: (undefined|!settings.Route),
* MANAGE_ACCESSIBILITY: (undefined|!settings.Route), * MANAGE_ACCESSIBILITY: (undefined|!settings.Route),
* MANAGE_GOOGLE_TTS_ENGINE_SETTINGS: (undefined|!settings.Route),
* MANAGE_PASSWORDS: (undefined|!settings.Route), * MANAGE_PASSWORDS: (undefined|!settings.Route),
* MANAGE_PROFILE: (undefined|!settings.Route), * MANAGE_PROFILE: (undefined|!settings.Route),
* MANAGE_TTS_SETTINGS: (undefined|!settings.Route), * MANAGE_TTS_SETTINGS: (undefined|!settings.Route),
...@@ -388,8 +387,6 @@ cr.define('settings', function() { ...@@ -388,8 +387,6 @@ cr.define('settings', function() {
r.ACCESSIBILITY.createChild('/manageAccessibility'); r.ACCESSIBILITY.createChild('/manageAccessibility');
r.MANAGE_TTS_SETTINGS = r.MANAGE_TTS_SETTINGS =
r.MANAGE_ACCESSIBILITY.createChild('/manageAccessibility/tts'); r.MANAGE_ACCESSIBILITY.createChild('/manageAccessibility/tts');
r.MANAGE_GOOGLE_TTS_ENGINE_SETTINGS = r.MANAGE_TTS_SETTINGS.createChild(
'/manageAccessibility/tts/googleTtsEngine');
// </if> // </if>
r.SYSTEM = r.ADVANCED.createSection('/system', 'system'); r.SYSTEM = r.ADVANCED.createSection('/system', 'system');
......
...@@ -34,12 +34,6 @@ ...@@ -34,12 +34,6 @@
<structure name="IDR_SETTINGS_TTS_SUBPAGE_HTML" <structure name="IDR_SETTINGS_TTS_SUBPAGE_HTML"
file="a11y_page/tts_subpage.html" file="a11y_page/tts_subpage.html"
type="chrome_html" /> type="chrome_html" />
<structure name="IDR_SETTINGS_GOOGLE_TTS_ENGINE_SUBPAGE_JS"
file="a11y_page/google_tts_engine_subpage.js"
type="chrome_html" />
<structure name="IDR_SETTINGS_GOOGLE_TTS_ENGINE_SUBPAGE_HTML"
file="a11y_page/google_tts_engine_subpage.html"
type="chrome_html" />
</if> </if>
<structure name="IDR_SETTINGS_ABOUT_PAGE_BROWSER_PROXY_HTML" <structure name="IDR_SETTINGS_ABOUT_PAGE_BROWSER_PROXY_HTML"
file="about_page/about_page_browser_proxy.html" file="about_page/about_page_browser_proxy.html"
......
...@@ -261,12 +261,6 @@ void AddA11yStrings(content::WebUIDataSource* html_source) { ...@@ -261,12 +261,6 @@ void AddA11yStrings(content::WebUIDataSource* html_source) {
{"textToSpeechPreviewPlay", IDS_SETTINGS_TEXT_TO_SPEECH_PREVIEW_PLAY}, {"textToSpeechPreviewPlay", IDS_SETTINGS_TEXT_TO_SPEECH_PREVIEW_PLAY},
{"textToSpeechEngines", IDS_SETTINGS_TEXT_TO_SPEECH_ENGINES}, {"textToSpeechEngines", IDS_SETTINGS_TEXT_TO_SPEECH_ENGINES},
{"textToSpeechInstallEngines", IDS_SETTINGS_TEXT_TO_SPEECH_INSTALL_ENGINES}, {"textToSpeechInstallEngines", IDS_SETTINGS_TEXT_TO_SPEECH_INSTALL_ENGINES},
{"manageGoogleTtsEngineSettings",
IDS_SETTINGS_MANAGE_GOOGLE_TTS_ENGINE_SETTINGS},
{"googleTtsEngineSettingsLinkDescription",
IDS_SETTINGS_GOOGLE_TTS_ENGINE_LINK_DESCRIPTION},
{"googleTextToSpeechSettings", IDS_SETTINGS_GOOGLE_TTS_ENGINE_TITLE},
{"enableTtsVoiceLabel", IDS_SETTINGS_ENABLE_TTS_VOICE_LABEL},
#endif #endif
}; };
AddLocalizedStringsBulk(html_source, localized_strings, AddLocalizedStringsBulk(html_source, localized_strings,
......
...@@ -82,7 +82,6 @@ js2gtest("browser_tests_js_webui") { ...@@ -82,7 +82,6 @@ js2gtest("browser_tests_js_webui") {
"settings/a11y/accessibility_a11y_test.js", "settings/a11y/accessibility_a11y_test.js",
"settings/a11y/basic_a11y_test.js", "settings/a11y/basic_a11y_test.js",
"settings/a11y/edit_dictionary_a11y_test.js", "settings/a11y/edit_dictionary_a11y_test.js",
"settings/a11y/google_tts_engine_subpage_a11y_test.js",
"settings/a11y/manage_accessibility_a11y_test.js", "settings/a11y/manage_accessibility_a11y_test.js",
"settings/a11y/manage_profile_a11y_test.js", "settings/a11y/manage_profile_a11y_test.js",
"settings/a11y/passwords_a11y_test.js", "settings/a11y/passwords_a11y_test.js",
......
// Copyright 2018 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 Define accessibility tests for the
* MANAGE_GOOGLE_TTS_ENGINE_SETTINGS route.
*/
// This is only for Chrome OS.
GEN('#if defined(OS_CHROMEOS)');
// SettingsAccessibilityTest fixture.
GEN_INCLUDE([
'settings_accessibility_test.js',
]);
GoogleTtsEngineAccessibilityTest = class extends SettingsAccessibilityTest {
/** @override */
get commandLineSwitches() {
return ['enable-experimental-a11y-features'];
}
/** @override */
get browsePreload() {
return 'chrome://settings/manageAccessibility/tts/googleTtsEngine';
}
};
AccessibilityTest.define('GoogleTtsEngineAccessibilityTest', {
/** @override */
name: 'MANAGE_GOOGLE_TTS_ENGINE_SETTINGS',
/** @override */
axeOptions: SettingsAccessibilityTest.axeOptions,
/** @override */
tests: {'Accessible with No Changes': function() {}},
/** @override */
violationFilter: SettingsAccessibilityTest.violationFilter,
});
GEN('#endif // defined(OS_CHROMEOS)');
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