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

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, 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 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..67e4b40a2be2ac6ee684fab907443a73b939a7bf
--- /dev/null
+++ b/chrome/browser/resources/chromeos/login/oobe_screen_voice_interaction_value_prop.js
@@ -0,0 +1,47 @@
+// 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 {
+
+ /** @Override */
+ onBeforeShow: function(data) {
+ var valueView = $('voice-interaction-value-prop-md').
+ getElement('value-prop-view');
+
+ valueView.addContentScripts([
+ {
+ name: 'stripLinks',
+ matches: ['<all_urls>'],
+ js: { code:
+ "document.querySelectorAll('a').forEach(" +
+ "function(anchor){anchor.href='javascript:void(0)';})"
+ },
+ run_at: 'document_end'
+ }]);
+
+ // TODO(updowndota): provide static content later for the final fallback.
+ valueView.request.onHeadersReceived.addListener(function(details) {
+ if (details.statusCode == '404') {
+ if (valueView.src !=
+ 'https://www.gstatic.com/opa-chromeos/oobe/en/value_proposition.html') {
+ valueView.src =
+ 'https://www.gstatic.com/opa-chromeos/oobe/en/value_proposition.html';
+ }
+ }
+ }, {urls: ['<all_urls>'], types: ['main_frame']});
+
+ 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