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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 /**
6 * @fileoverview Oobe Voice Interaction Value Prop screen implementation.
7 */
8
9 login.createScreen('VoiceInteractionValuePropScreen',
10 'voice-interaction-value-prop', function() {
11 return {
12
13 /** @Override */
14 onBeforeShow: function(data) {
15 var valueView = $('voice-interaction-value-prop-md').
16 getElement('value-prop-view');
17
18 valueView.addContentScripts([
19 {
20 name: 'stripLinks',
21 matches: ['<all_urls>'],
22 js: { code:
23 "document.querySelectorAll('a').forEach(" +
24 "function(anchor){anchor.href='javascript:void(0)';})"
25 },
26 run_at: 'document_end'
27 }]);
28
29 // TODO(updowndota): provide static content later for the final fallback.
30 valueView.request.onHeadersReceived.addListener(function(details) {
31 if (details.statusCode == '404') {
32 if (valueView.src !=
33 'https://www.gstatic.com/opa-chromeos/oobe/en/value_proposition.ht ml') {
34 valueView.src =
35 'https://www.gstatic.com/opa-chromeos/oobe/en/value_proposition.ht ml';
36 }
37 }
38 }, {urls: ['<all_urls>'], types: ['main_frame']});
39
40 var locale = loadTimeData.getString('locale');
41 valueView.src = 'https://www.gstatic.com/opa-chromeos/oobe/' + locale
42 + '/value_proposition.html';
43
44 Oobe.getInstance().headerHidden = true;
45 }
46 };
47 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698