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

Unified Diff: chrome/browser/resources/chromeos/login/oobe_screen_voice_interaction_value_prop.js

Issue 2912593002: Create OOBE screen for Voice Interaction value proposition (Closed)
Patch Set: Create OOBE screen for Voice Interaction value proposition Created 3 years, 7 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/chromeos/login/oobe_screen_voice_interaction_value_prop.js
diff --git a/chrome/browser/resources/chromeos/login/oobe_screen_voice_interaction_value_prop.js b/chrome/browser/resources/chromeos/login/oobe_screen_voice_interaction_value_prop.js
new file mode 100644
index 0000000000000000000000000000000000000000..6c3479c301c33f0d7abfe105fc81d8d28e3d1f9b
--- /dev/null
+++ b/chrome/browser/resources/chromeos/login/oobe_screen_voice_interaction_value_prop.js
@@ -0,0 +1,35 @@
+// Copyright 2017 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 Oobe Voice Interaction Value Prop screen implementation.
+ */
+
+login.createScreen('VoiceInteractionValuePropScreen',
+ 'voice-interaction-value-prop', function() {
+ return {
+
+ /**
+ * Event handler that is invoked just before the screen is shown.
+ * @param {object} data Screen init payload.
+ */
xiyuan 2017/06/02 22:12:33 nit: This can be just /** @override */ for ove
yueli 2017/06/06 17:38:19 Done.
+ onBeforeShow: function(data) {
+ var valueView = $('voice-interaction-value-prop-md').
+ getElement('value-prop-view');
+
+ valueView.request.onHeadersReceived.addListener(function(details) {
xiyuan 2017/06/02 22:12:33 Should we use onErrorOccurred to catch all errors
+ if (details.statusLine.match(/^HTTP.*404/)) {
xiyuan 2017/06/02 22:12:34 details.statusCode instead of manually parsing. An
+ valueView.src =
+ 'https://www.gstatic.com/opa-chromeos/oobe/en/value_proposition.html';
xc 2017/06/02 18:53:48 if the "en" url were also 404, which should never
xiyuan 2017/06/02 22:12:34 Good point. Please do. The simplest way is to chec
yueli 2017/06/06 17:38:19 Done.
+ }
+ }, {urls: ['<all_urls>']});
xiyuan 2017/06/02 22:12:33 Think we only care about main frame loading proble
yueli 2017/06/06 17:38:19 Done.
+
+ var locale = loadTimeData.getString('locale');
+ valueView.src = 'https://www.gstatic.com/opa-chromeos/oobe/' + locale
+ + '/value_proposition.html';
+
+ Oobe.getInstance().headerHidden = true;
+ }
+ };
+});

Powered by Google App Engine
This is Rietveld 408576698