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

Unified Diff: chrome/browser/resources/hotword/audio_client.js

Issue 600523004: Support hotwording on google.com and the new tab page. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More review comments. Created 6 years, 2 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
Index: chrome/browser/resources/hotword/audio_client.js
diff --git a/chrome/browser/resources/hotword_helper/audio_client.js b/chrome/browser/resources/hotword/audio_client.js
similarity index 98%
copy from chrome/browser/resources/hotword_helper/audio_client.js
copy to chrome/browser/resources/hotword/audio_client.js
index 927e0f7892c14d01e89a8c753815350ec2d431b2..60ee57943bc16b0762365a610f03159f98d83f65 100644
--- a/chrome/browser/resources/hotword_helper/audio_client.js
+++ b/chrome/browser/resources/hotword/audio_client.js
@@ -1,4 +1,4 @@
-// Copyright (c) 2014 The Chromium Authors. All rights reserved.
+// Copyright 2014 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.
@@ -10,8 +10,6 @@
* Hotword extension.
*/
-
-
(function() {
/**
* @constructor
@@ -43,7 +41,6 @@
this.handleCommandFromPageFunc_ = null;
};
-
/**
* Messages sent to the page to control the voice search UI.
* @enum {string}
@@ -56,7 +53,6 @@
HOTWORD_ERROR: 'he'
};
-
/**
* Messages received from the page used to indicate voice search state.
* @enum {string}
@@ -73,7 +69,6 @@
CLICKED_DEBUG: 'hcd'
};
-
/**
* Errors that are sent to the hotword extension.
* @enum {string}
@@ -85,13 +80,11 @@
NO_HOTWORD_ERROR_UI: 'ac4'
};
-
/**
* @const {string}
* @private
*/
- AudioClient.HOTWORD_EXTENSION_ID_ = 'bepbmhgboaologfdajaanbcjmnhjmhfn';
-
+ AudioClient.HOTWORD_EXTENSION_ID_ = 'nbpagnldghgfoolbancepceaanlmhfmd';
/**
* Number of times to retry checking a transient error.
@@ -100,7 +93,6 @@
*/
AudioClient.MAX_RETRIES = 3;
-
/**
* Delay to wait in milliseconds before rechecking for any transient errors.
* @const {number}
@@ -108,7 +100,6 @@
*/
AudioClient.RETRY_TIME_MS_ = 2000;
-
/**
* DOM ID for the speech UI overlay.
* @const {string}
@@ -116,7 +107,6 @@
*/
AudioClient.SPEECH_UI_OVERLAY_ID_ = 'spch';
-
/**
* @const {string}
* @private
@@ -124,7 +114,6 @@
AudioClient.HELP_CENTER_URL_ =
'https://support.google.com/chrome/?p=ui_hotword_search';
-
/**
* @const {string}
* @private
@@ -138,7 +127,6 @@
*/
AudioClient.EXISTS_ = 'chwace';
-
/**
* Checks for the presence of speech overlay UI DOM elements.
* @private
@@ -152,7 +140,6 @@
}
};
-
/**
* Function called to check for the speech UI overlay after some time has
* passed since an initial check. Will either retry triggering the speech
@@ -174,7 +161,6 @@
}
};
-
/**
* Checks that the triggered UI is actually displayed.
* @param {AudioClient.CommandToPage} command Command that was send.
@@ -186,7 +172,6 @@
AudioClient.RETRY_TIME_MS_);
};
-
/**
* Function called when the UI verification is not called in time. Will either
* retry the command or sends an error message, depending on the number of
@@ -203,7 +188,6 @@
}
};
-
/**
* Confirm that an UI element has been shown.
* @param {AudioClient.CommandToPage} command UI to confirm.
@@ -217,7 +201,6 @@
}
};
-
/**
* Sends a command to the audio manager.
* @param {string} commandStr command to send to plugin.
@@ -228,7 +211,6 @@
this.port_.postMessage({'cmd': commandStr});
};
-
/**
* Handles a message from the audio manager.
* @param {{cmd: string}} commandObj Command from the audio manager.
@@ -261,7 +243,6 @@
}
};
-
/**
* @param {AudioClient.CommandToPage} commandStr Command to send.
* @private
@@ -270,7 +251,6 @@
window.postMessage({'type': commandStr}, '*');
};
-
/**
* Handles a message from the html window.
* @param {!MessageEvent} messageEvent Message event from the window.
@@ -318,7 +298,6 @@
}
};
-
/**
* Initialize the content script.
*/
@@ -350,7 +329,6 @@
this.initPort_();
};
-
/**
* Initialize the communications port with the audio manager. This
* function will be also be called again if the audio-manager
@@ -381,7 +359,6 @@
this.sendCommandToExtension_(AudioClient.CommandFromPage.SPEECH_START);
};
-
// Initializes as soon as the code is ready, do not wait for the page.
new AudioClient().initialize();
})();
« no previous file with comments | « chrome/browser/resources/component_extension_resources.grd ('k') | chrome/browser/resources/hotword/constants.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698