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

Side by Side Diff: chrome/browser/resources/ssl/captive_portal.js

Issue 318213002: Add custom interstitial for captive portals. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix build Created 6 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright 2014 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 var expandedDetails = false;
6 var CMD_OPEN_LOGIN_PAGE = 1;
7 var CMD_MORE = 2;
8
9 function sendCommand(cmd) {
10 window.domAutomationController.setAutomationId(1);
11 window.domAutomationController.send(cmd);
12 }
13
14 function setupEvents() {
15 $('primary-button').addEventListener('click', function() {
16 sendCommand(CMD_OPEN_LOGIN_PAGE);
17 });
18
19 $('details-button').addEventListener('click', function(event) {
20 var hiddenDetails = $('details').classList.toggle('hidden');
21 $('details-button').innerText = hiddenDetails ?
22 loadTimeData.getString('openDetails') :
23 loadTimeData.getString('closeDetails');
24 if (!expandedDetails) {
25 // Record a histogram entry only the first time that details is opened.
26 sendCommand(CMD_MORE);
27 expandedDetails = true;
28 }
29 event.preventDefault();
30 });
31 }
32
33 document.addEventListener('DOMContentLoaded', setupEvents);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698