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

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..d24cb56170d545d010398062f7ae71d305eed813 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.
@@ -202,6 +210,8 @@ function BrowserBridge() {
this.sendGetServiceProviders.bind(this));
}
+ this.hstsQueryCallback = null;
+
// Cache of the data received.
this.numPassivelyCapturedEvents_ = 0;
this.capturedEvents_ = [];
@@ -301,6 +311,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 +494,11 @@ BrowserBridge.prototype.receivedCompletedConnectionTestSuite = function() {
this.connectionTestsObservers_[i].onCompletedConnectionTestSuite();
};
+BrowserBridge.prototype.receivedHSTSResult = function(info) {
+ if (this.hstsQueryCallback)
eroman 2011/02/16 20:12:45 Can you use an observer list instead?
agl 2011/02/16 22:46:22 Done.
+ this.hstsQueryCallback(info);
+};
+
BrowserBridge.prototype.receivedHttpCacheInfo = function(info) {
this.pollableDataHelpers_.httpCacheInfo.update(info);
};

Powered by Google App Engine
This is Rietveld 408576698