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

Side by Side Diff: chrome/browser/resources/hotword_audio_verification/main.js

Issue 2059913002: Remove keyIdentifier usage in chrome/browser/resources/* (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix chromeos build Created 4 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 var appWindow = chrome.app.window.current(); 5 var appWindow = chrome.app.window.current();
6 6
7 document.addEventListener('DOMContentLoaded', function() { 7 document.addEventListener('DOMContentLoaded', function() {
8 chrome.hotwordPrivate.getLocalizedStrings(function(strings) { 8 chrome.hotwordPrivate.getLocalizedStrings(function(strings) {
9 loadTimeData.data = strings; 9 loadTimeData.data = strings;
10 i18nTemplate.process(document, loadTimeData); 10 i18nTemplate.process(document, loadTimeData);
11 11
12 var flow = new Flow(); 12 var flow = new Flow();
13 flow.startFlow(); 13 flow.startFlow();
14 14
15 var pressFunction = function(e) { 15 var pressFunction = function(e) {
16 // Only respond to 'Enter' key presses. 16 // Only respond to 'Enter' key presses.
17 if (e.type == 'keyup' && e.keyIdentifier != 'Enter') 17 if (e.type == 'keyup' && e.key != 'Enter')
18 return; 18 return;
19 19
20 var classes = e.target.classList; 20 var classes = e.target.classList;
21 if (classes.contains('close') || classes.contains('finish-button')) { 21 if (classes.contains('close') || classes.contains('finish-button')) {
22 flow.stopTraining(); 22 flow.stopTraining();
23 appWindow.close(); 23 appWindow.close();
24 e.preventDefault(); 24 e.preventDefault();
25 } 25 }
26 if (classes.contains('retry-button')) { 26 if (classes.contains('retry-button')) {
27 flow.handleRetry(); 27 flow.handleRetry();
(...skipping 13 matching lines...) Expand all
41 flow.advanceStep(); 41 flow.advanceStep();
42 e.preventDefault(); 42 e.preventDefault();
43 }); 43 });
44 44
45 $('settings-link').addEventListener('click', function(e) { 45 $('settings-link').addEventListener('click', function(e) {
46 chrome.browser.openTab({'url': 'chrome://settings'}, function() {}); 46 chrome.browser.openTab({'url': 'chrome://settings'}, function() {});
47 e.preventDefault(); 47 e.preventDefault();
48 }); 48 });
49 }); 49 });
50 }); 50 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/history/history.js ('k') | chrome/browser/resources/inspect/inspect.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698