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

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 android tests, add more uma, address mmenke's comments 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);
mmenke 2014/06/20 16:07:08 nit: Believe this should use a 2-space indent.
meacer 2014/06/20 23:28:14 Done.
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);
mmenke 2014/06/20 16:07:08 nit: Should be consistent - use more everywhere,
meacer 2014/06/20 23:28:14 Renamed to SHOW_DETAILS.
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