Chromium Code Reviews| 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. |
| * |