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

Unified Diff: chrome/browser/resources/net_internals/hstsview.js

Issue 7531005: Rename the net_internals file names to include hyphens. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Add some missing files Created 9 years, 5 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/net_internals/hstsview.js
===================================================================
--- chrome/browser/resources/net_internals/hstsview.js (revision 94551)
+++ chrome/browser/resources/net_internals/hstsview.js (working copy)
@@ -1,138 +0,0 @@
-// Copyright (c) 2011 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.
-
-/**
- * HSTS is HTTPS Strict Transport Security: a way for sites to elect to always
- * use HTTPS. See http://dev.chromium.org/sts
- *
- * This UI allows a user to query and update the browser's list of HSTS domains.
-
- * @constructor
- */
-function HSTSView() {
- const mainBoxId = 'hstsTabContent';
- const queryInputId = 'hstsQueryInput';
- const formId = 'hstsQueryForm';
- const queryOutputDivId = 'hstsQueryOutput';
- const addInputId = 'hstsAddInput';
- const addFormId = 'hstsAddForm';
- const addCheckId = 'hstsCheckInput';
- const addPinsId = 'hstsAddPins';
- const deleteInputId = 'hstsDeleteInput';
- const deleteFormId = 'hstsDeleteForm';
-
- DivView.call(this, mainBoxId);
-
- this.queryInput_ = $(queryInputId);
- this.addCheck_ = $(addCheckId);
- this.addInput_ = $(addInputId);
- this.addPins_ = $(addPinsId);
- this.deleteInput_ = $(deleteInputId);
- this.queryOutputDiv_ = $(queryOutputDivId);
-
- var form = $(formId);
- form.addEventListener('submit', this.onSubmitQuery_.bind(this), false);
- form = $(addFormId);
- form.addEventListener('submit', this.onSubmitAdd_.bind(this), false);
- form = $(deleteFormId);
- form.addEventListener('submit', this.onSubmitDelete_.bind(this), false);
-
- g_browser.addHSTSObserver(this);
-}
-
-inherits(HSTSView, DivView);
-
-HSTSView.prototype.onSubmitQuery_ = function(event) {
- g_browser.sendHSTSQuery(this.queryInput_.value);
- event.preventDefault();
-};
-
-HSTSView.prototype.onSubmitAdd_ = function(event) {
- g_browser.sendHSTSAdd(this.addInput_.value,
- this.addCheck_.checked,
- this.addPins_.value);
- g_browser.sendHSTSQuery(this.addInput_.value);
- this.queryInput_.value = this.addInput_.value;
- this.addCheck_.checked = false;
- this.addInput_.value = '';
- this.addPins_.value = '';
- event.preventDefault();
-};
-
-HSTSView.prototype.onSubmitDelete_ = function(event) {
- g_browser.sendHSTSDelete(this.deleteInput_.value);
- this.deleteInput_.value = '';
- event.preventDefault();
-};
-
-function hstsModeToString(m) {
- if (m == 0) {
- return 'STRICT';
- } else if (m == 1) {
- return 'OPPORTUNISTIC';
- } else if (m == 2) {
- return 'SPDY';
- } else if (m == 3) {
- return 'NONE';
- } else {
- return 'UNKNOWN';
- }
-}
-
-function yellowFade(element) {
- element.style.webkitTransitionProperty = 'background-color';
- element.style.webkitTransitionDuration = '0';
- element.style.backgroundColor = '#fffccf';
- setTimeout(function() {
- element.style.webkitTransitionDuration = '1000ms';
- element.style.backgroundColor = '#fff';
- }, 0);
-}
-
-HSTSView.prototype.onHSTSQueryResult = function(result) {
- if (result.error != undefined) {
- this.queryOutputDiv_.innerHTML = '';
- s = addNode(this.queryOutputDiv_, 'span');
- s.textContent = result.error;
- s.style.color = 'red';
- yellowFade(this.queryOutputDiv_);
- return;
- }
-
- if (result.result == false) {
- this.queryOutputDiv_.innerHTML = '<b>Not found</b>';
- yellowFade(this.queryOutputDiv_);
- return;
- }
-
- this.queryOutputDiv_.innerHTML = '';
-
- s = addNode(this.queryOutputDiv_, 'span');
- s.innerHTML = '<b>Found</b>: mode: ';
-
- t = addNode(this.queryOutputDiv_, 'tt');
- t.textContent = hstsModeToString(result.mode);
-
- addTextNode(this.queryOutputDiv_, ' include_subdomains:');
-
- t = addNode(this.queryOutputDiv_, 'tt');
- t.textContent = result.subdomains;
-
- addTextNode(this.queryOutputDiv_, ' domain:');
-
- t = addNode(this.queryOutputDiv_, 'tt');
- t.textContent = result.domain;
-
- addTextNode(this.queryOutputDiv_, ' is_preloaded:');
-
- t = addNode(this.queryOutputDiv_, 'tt');
- t.textContent = result.preloaded;
-
- addTextNode(this.queryOutputDiv_, ' pubkey_hashes:');
-
- t = addNode(this.queryOutputDiv_, 'tt');
- t.textContent = result.public_key_hashes;
-
- yellowFade(this.queryOutputDiv_);
-}
« no previous file with comments | « chrome/browser/resources/net_internals/hsts_view.js ('k') | chrome/browser/resources/net_internals/http-cache-view.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698