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

Unified Diff: netlog_viewer/alt_svc_view.js

Issue 2162963002: [polymer] Merge of master into polymer10-migration (Closed) Base URL: git@github.com:catapult-project/catapult.git@polymer10-migration
Patch Set: Merge polymer10-migration int polymer10-merge Created 4 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
« no previous file with comments | « netlog_viewer/alt_svc_view.html ('k') | netlog_viewer/assert.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: netlog_viewer/alt_svc_view.js
diff --git a/netlog_viewer/alt_svc_view.js b/netlog_viewer/alt_svc_view.js
new file mode 100644
index 0000000000000000000000000000000000000000..a452b212947d1694d91e6e30286eaf2467fedd73
--- /dev/null
+++ b/netlog_viewer/alt_svc_view.js
@@ -0,0 +1,62 @@
+// Copyright (c) 2012 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.
+
+/**
+ * This view displays the Alt-Svc mappings.
+ */
+var AltSvcView = (function() {
+ 'use strict';
+
+ // We inherit from DivView.
+ var superClass = DivView;
+
+ /**
+ * @constructor
+ */
+ function AltSvcView() {
+ assertFirstConstructorCall(AltSvcView);
+
+ // Call superclass's constructor.
+ superClass.call(this, AltSvcView.MAIN_BOX_ID);
+
+ g_browser.addAltSvcMappingsObserver(this, true);
+ }
+
+ AltSvcView.TAB_ID = 'tab-handle-alt-svc';
+ AltSvcView.TAB_NAME = 'Alt-Svc';
+ AltSvcView.TAB_HASH = '#alt-svc';
+
+ // IDs for special HTML elements in alt_svc_view.html
+ AltSvcView.MAIN_BOX_ID = 'alt-svc-view-tab-content';
+ AltSvcView.ALTERNATE_PROTOCOL_MAPPINGS_ID =
+ 'alt-svc-view-alternate-protocol-mappings';
+
+ cr.addSingletonGetter(AltSvcView);
+
+ AltSvcView.prototype = {
+ // Inherit the superclass's methods.
+ __proto__: superClass.prototype,
+
+ onLoadLogFinish: function(data) {
+ // TODO(rch): Remove the check for spdyAlternateProtocolMappings after
+ // M53 (It was renamed to altSvcMappings in M50).
+ return this.onAltSvcMappingsChanged(data.altSvcMappings ||
+ data.spdyAlternateProtocolMappings);
+ },
+
+ /**
+ * Displays the alternate service mappings.
+ */
+ onAltSvcMappingsChanged: function(altSvcMappings) {
+ if (!altSvcMappings)
+ return false;
+ // TODO(rayraymond): Update DOM without use of jstemplate.
+ // var input = new JsEvalContext({altSvcMappings: altSvcMappings});
+ // jstProcess(input, $(AltSvcView.ALTERNATE_PROTOCOL_MAPPINGS_ID));
+ return true;
+ }
+ };
+
+ return AltSvcView;
+})();
« no previous file with comments | « netlog_viewer/alt_svc_view.html ('k') | netlog_viewer/assert.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698