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

Side by Side Diff: chrome/browser/resources/chromeos/neterror.js

Issue 129693002: Properly launch the connectivity diagnostics app from the offline page (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 function toggleHelpBox() { 5 function toggleHelpBox() {
6 var helpBoxOuter = $('help-box-outer'); 6 var helpBoxOuter = $('help-box-outer');
7 helpBoxOuter.classList.toggle('hidden'); 7 helpBoxOuter.classList.toggle('hidden');
8 var moreLessButton = $('more-less-button'); 8 var moreLessButton = $('more-less-button');
9 if (helpBoxOuter.classList.contains('hidden')) { 9 if (helpBoxOuter.classList.contains('hidden')) {
10 moreLessButton.innerText = moreLessButton.moreText; 10 moreLessButton.innerText = moreLessButton.moreText;
11 } else { 11 } else {
12 moreLessButton.innerText = moreLessButton.lessText; 12 moreLessButton.innerText = moreLessButton.lessText;
13 } 13 }
14 } 14 }
15 15
16 function diagnoseErrors() { 16 function diagnoseErrors() {
17 var extensionId = 'idddmepepmjcgiedknnmlbadcokidhoa'; 17 window.domAutomationController.setAutomationId(1);
18 var diagnoseFrame = $('diagnose-frame'); 18 window.domAutomationController.send('open_connectivity_diagnostics');
19 diagnoseFrame.innerHTML =
20 '<iframe src="chrome-extension://' + extensionId +
21 '/index.html"></iframe>';
22 } 19 }
23 20
24 // Subframes use a different layout but the same html file. This is to make it 21 // Subframes use a different layout but the same html file. This is to make it
25 // easier to support platforms that load the error page via different 22 // easier to support platforms that load the error page via different
26 // mechanisms (Currently just iOS). 23 // mechanisms (Currently just iOS).
27 if (window.top.location != window.location) 24 if (window.top.location != window.location)
28 document.documentElement.setAttribute('subframe', ''); 25 document.documentElement.setAttribute('subframe', '');
29 26
30 // Re-renders the error page using |strings| as the dictionary of values. 27 // Re-renders the error page using |strings| as the dictionary of values.
31 // Used by NetErrorTabHelper to update DNS error pages with probe results. 28 // Used by NetErrorTabHelper to update DNS error pages with probe results.
(...skipping 13 matching lines...) Expand all
45 if (oldClass == newClass) 42 if (oldClass == newClass)
46 return; 43 return;
47 } 44 }
48 45
49 classList.add(newClass); 46 classList.add(newClass);
50 if (oldClass !== undefined) 47 if (oldClass !== undefined)
51 classList.remove(oldClass); 48 classList.remove(oldClass);
52 49
53 classList['last_icon_class'] = newClass; 50 classList['last_icon_class'] = newClass;
54 } 51 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698