cros: Remove default pinned apps trial.
[chromium-blink-merge.git] / chrome / browser / resources / net_internals / http_pipeline_view.js
blob14c35a642f1d2dad3e009566062e21331376d2ba
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 /**
6  * This view displays a summary of the state of each HTTP pipelined connection,
7  * and has links to display them in the events tab.
8  */
9 var HttpPipelineView = (function() {
10   'use strict';
12   // We inherit from DivView.
13   var superClass = DivView;
15   /**
16    * @constructor
17    */
18   function HttpPipelineView() {
19     assertFirstConstructorCall(HttpPipelineView);
21     // Call superclass's constructor.
22     superClass.call(this, HttpPipelineView.MAIN_BOX_ID);
24     g_browser.addHttpPipeliningStatusObserver(this, true);
25   }
27   HttpPipelineView.TAB_ID = 'tab-handle-http-pipeline';
28   HttpPipelineView.TAB_NAME = 'Pipelining';
29   HttpPipelineView.TAB_HASH = '#httpPipeline';
31   // IDs for special HTML elements in http_pipeline_view.html
32   HttpPipelineView.MAIN_BOX_ID = 'http-pipeline-view-tab-content';
33   HttpPipelineView.ENABLED_SPAN_ID = 'http-pipeline-view-enabled-span';
34   HttpPipelineView.KNOWN_HOSTS_TABLE_ID =
35       'http-pipeline-view-known-hosts-table';
37   cr.addSingletonGetter(HttpPipelineView);
39   HttpPipelineView.prototype = {
40     // Inherit the superclass's methods.
41     __proto__: superClass.prototype,
43     onLoadLogFinish: function(data) {
44       return this.onHttpPipeliningStatusChanged(data.httpPipeliningStatus);
45     },
47     /**
48      * Displays information on the global HTTP pipelining status.
49      */
50     onHttpPipeliningStatusChanged: function(httpPipeliningStatus) {
51       if (!httpPipeliningStatus)
52         return false;
53       var input = new JsEvalContext(httpPipeliningStatus);
54       jstProcess(input, $(HttpPipelineView.MAIN_BOX_ID));
55       // Hide view in loaded logs if pipelining isn't enabled.
56       return httpPipeliningStatus.pipelining_enabled;
57     },
58   };
60   return HttpPipelineView;
61 })();