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

Unified Diff: chrome/browser/resources/settings/search_page/search_page.html

Issue 2507363002: MD Settings: Add Hotword (OK Google) section to search_page (Closed)
Patch Set: Self Review Created 4 years, 1 month 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/settings/search_page/search_page.html
diff --git a/chrome/browser/resources/settings/search_page/search_page.html b/chrome/browser/resources/settings/search_page/search_page.html
index 3caa43a60661b9947ed2d608cdebd9e33d14c31a..622187daf4c80d41faf96a50cb31f89c913fe802 100644
--- a/chrome/browser/resources/settings/search_page/search_page.html
+++ b/chrome/browser/resources/settings/search_page/search_page.html
@@ -1,7 +1,12 @@
+<link rel="import" href="chrome://resources/html/i18n_behavior.html">
<link rel="import" href="chrome://resources/html/md_select_css.html">
<link rel="import" href="chrome://resources/html/polymer.html">
<link rel="import" href="chrome://resources/polymer/v1_0/neon-animation/neon-animatable.html">
+<link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-button.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper-icon-button-light.html">
+<link rel="import" href="/controls/settings_checkbox.html">
+<link rel="import" href="/icons.html">
+<link rel="import" href="/i18n_setup.html">
<link rel="import" href="/route.html">
<link rel="import" href="/search_engines_page/search_engines_page.html">
<link rel="import" href="/search_engines_page/search_engines_browser_proxy.html">
@@ -12,9 +17,18 @@
<dom-module id="settings-search-page">
<template>
- <style include="settings-shared md-select"></style>
+ <style include="settings-shared md-select">
+ iron-icon {
+ -webkit-padding-end: 16px;
+ }
+
+ .indented {
+ -webkit-margin-start: 36px;
+ }
+ </style>
<settings-animated-pages id="pages" section="search">
<neon-animatable route-path="default">
+ <!-- Omnibox search engine -->
<div class="settings-box first">
<p class="start">$i18n{searchExplanation}</p>
<div>
@@ -26,6 +40,54 @@
<span class="md-select-underline"></span>
</div>
</div>
+
+ <template is="dom-if" if="[[hotwordInfo_.allowed]]">
+ <!-- Hotword (OK Google) -->
+ <div class="settings-box two-line">
+ <settings-checkbox id="hotwordSearchEnable" class="start"
+ label="$i18n{searchOkGoogleLabel}"
+ sub-label="[[getHotwordSearchEnableSubLabel_(
+ hotwordInfo_.alwaysOn)]]"
+ pref="{{hotwordSearchEnablePref_}}"
+ on-change="onHotwordSearchEnableChange_">
+ <a href="$i18nRaw{hotwordLearnMoreUrl}" target="_blank"
+ on-tap="doNothing_">
+ $i18n{learnMore}.
michaelpg 2016/11/27 22:25:36 "." should be part of i18n if it's required. "Lear
stevenjb 2016/11/28 20:53:36 Switched to a hotword specific string.
+ </a>
+ </settings-checkbox>
+ <div class="secondary-action"
+ hidden$="[[!getShowHotwordSearchRetrain_(hotwordInfo_.*)]]">
+ <paper-button on-tap="onRetrainTap_" class="secondary-button">
+ $i18n{searchOkGoogleRetrain}
+ </paper-button>
+ </div>
+ </div>
+
+ <template is="dom-if"
+ if="[[getShowHotwordError_(hotwordInfo_.*,
+ hotwordSearchEnablePref_)]]">
+ <div class="settings-box continuation indented">
+ <iron-icon icon="settings:warning"></iron-icon>
+ <div inner-h-t-m-l="[[hotwordInfo_.errorMessage]]"</div>
michaelpg 2016/11/27 22:25:35 missing >
stevenjb 2016/11/28 20:53:36 <grumble>sloppy html parsing</grumble> Done.
+ </div>
+ </template>
+
+ <template is="dom-if" if="[[hotwordInfo_.historyEnabled]]">
+ <div class="settings-box two-line continuation indented"
+ on-tap="onManageAudioHistoryTap_" actionable>
+ <div class="start">
+ <div>[[i18n('searchOkGoogleAudioHistoryLabel',
michaelpg 2016/11/27 22:25:34 nit: if [[]] has to break, can those be separate l
stevenjb 2016/11/28 20:53:36 Done.
+ hotwordInfo_.userName)]]</div>
+ <div class="secondary">$i18n{searchOkGoogleAudioHistorySubtext}
+ </div>
+ </div>
+ <button class="icon-external" is="paper-icon-button-light">
+ </button>
+ </div>
+ </template>
+ </template>
+
+ <!-- Manage search engines -->
<div id="subpage-trigger" class="settings-box two-line"
on-tap="onManageSearchEnginesTap_" actionable>
<div class="start">

Powered by Google App Engine
This is Rietveld 408576698