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

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

Issue 6500010: HSTS: add net-internals UI. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ... Created 9 years, 10 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/main.js
diff --git a/chrome/browser/resources/net_internals/main.js b/chrome/browser/resources/net_internals/main.js
index ed803c551cfbe9837aa46bdfcb27c5948cf8bff2..cfcbe42e6b197866b1668d992793d3b46ceaf83d 100644
--- a/chrome/browser/resources/net_internals/main.js
+++ b/chrome/browser/resources/net_internals/main.js
@@ -87,6 +87,13 @@ function onLoaded() {
var testView = new TestView('testTabContent', 'testUrlInput',
'connectionTestsForm', 'testSummary');
+ // Create a view which allows the user to query and alter the HSTS database.
+ var hstsView = new HSTSView('hstsTabContent',
+ 'hstsQueryInput', 'hstsQueryForm',
+ 'hstsQueryOutput',
+ 'hstsAddInput', 'hstsAddForm', 'hstsCheckInput',
+ 'hstsDeleteInput', 'hstsDeleteForm');
+
var httpCacheView = new HttpCacheView('httpCacheTabContent',
'httpCacheStats');
@@ -128,6 +135,7 @@ function onLoaded() {
if (g_browser.isPlatformWindows())
categoryTabSwitcher.addTab('serviceProvidersTab', serviceView, false);
categoryTabSwitcher.addTab('testTab', testView, false);
+ categoryTabSwitcher.addTab('hstsTab', hstsView, false);
// Build a map from the anchor name of each tab handle to its "tab ID".
// We will consider navigations to the #hash as a switch tab request.
@@ -169,6 +177,7 @@ function BrowserBridge() {
// List of observers for various bits of browser state.
this.logObservers_ = [];
this.connectionTestsObservers_ = [];
+ this.hstsObservers_ = [];
this.pollableDataHelpers_ = {};
this.pollableDataHelpers_.proxySettings =
@@ -301,6 +310,18 @@ BrowserBridge.prototype.sendStartConnectionTests = function(url) {
chrome.send('startConnectionTests', [url]);
};
+BrowserBridge.prototype.sendHSTSQuery = function(domain) {
+ chrome.send('hstsQuery', [domain]);
+};
+
+BrowserBridge.prototype.sendHSTSAdd = function(domain, include_subdomains) {
+ chrome.send('hstsAdd', [domain, include_subdomains]);
+};
+
+BrowserBridge.prototype.sendHSTSDelete = function(domain) {
+ chrome.send('hstsDelete', [domain]);
+};
+
BrowserBridge.prototype.sendGetHttpCacheInfo = function() {
chrome.send('getHttpCacheInfo');
};
@@ -472,6 +493,11 @@ BrowserBridge.prototype.receivedCompletedConnectionTestSuite = function() {
this.connectionTestsObservers_[i].onCompletedConnectionTestSuite();
};
+BrowserBridge.prototype.receivedHSTSResult = function(info) {
+ for (var i = 0; i < this.hstsObservers_.length; ++i)
+ this.hstsObservers_[i].onHSTSQueryResult(info);
+};
+
BrowserBridge.prototype.receivedHttpCacheInfo = function(info) {
this.pollableDataHelpers_.httpCacheInfo.update(info);
};
@@ -694,6 +720,16 @@ BrowserBridge.prototype.addHttpCacheInfoObserver = function(observer) {
};
/**
+ * Adds a listener for the results of HSTS (HTTPS Strict Transport Security)
+ * queries. The observer will be called back with:
+ *
+ * observer.onHSTSQueryResult((result);
eroman 2011/02/17 00:48:28 nit: typo, unmatched paren.
agl 2011/02/17 17:21:30 Done.
+ */
+BrowserBridge.prototype.addHSTSObserver = function(observer) {
+ this.hstsObservers_.push(observer);
+};
+
+/**
* The browser gives us times in terms of "time ticks" in milliseconds.
* This function converts the tick count to a Date() object.
*

Powered by Google App Engine
This is Rietveld 408576698