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

Side by Side Diff: chrome/browser/resources/net_internals/http_throttling_view.js

Issue 10185003: Remove net-internals page for throttling, introduce flag for extension devs instead. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix JavaScript presubmit. Created 8 years, 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2011 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.
4
5 /**
6 * This view displays information related to HTTP throttling.
7 */
8 var HttpThrottlingView = (function() {
9 'use strict';
10
11 // We inherit from DivView.
12 var superClass = DivView;
13
14 /**
15 * @constructor
16 */
17 function HttpThrottlingView() {
18 assertFirstConstructorCall(HttpThrottlingView);
19
20 // Call superclass's constructor.
21 superClass.call(this, HttpThrottlingView.MAIN_BOX_ID);
22
23 this.enableCheckbox_ = $(HttpThrottlingView.ENABLE_CHECKBOX_ID);
24 this.enableCheckbox_.onclick = this.onEnableCheckboxClicked_.bind(this);
25
26 g_browser.addHttpThrottlingObserver(this);
27 }
28
29 // ID for special HTML element in category_tabs.html
30 HttpThrottlingView.TAB_HANDLE_ID = 'tab-handle-http-throttling';
31
32 // IDs for special HTML elements in http_throttling_view.html
33 HttpThrottlingView.MAIN_BOX_ID = 'http-throttling-view-tab-content';
34 HttpThrottlingView.ENABLE_CHECKBOX_ID =
35 'http-throttling-view-enable-checkbox';
36
37 cr.addSingletonGetter(HttpThrottlingView);
38
39 HttpThrottlingView.prototype = {
40 // Inherit the superclass's methods.
41 __proto__: superClass.prototype,
42
43 /**
44 * Gets informed that HTTP throttling has been enabled/disabled.
45 * @param {boolean} enabled HTTP throttling has been enabled.
46 */
47 onHttpThrottlingEnabledPrefChanged: function(enabled) {
48 this.enableCheckbox_.checked = enabled;
49 },
50
51 /**
52 * Handler for the onclick event of the checkbox.
53 */
54 onEnableCheckboxClicked_: function() {
55 g_browser.enableHttpThrottling(this.enableCheckbox_.checked);
56 }
57 };
58
59 return HttpThrottlingView;
60 })();
OLDNEW
« no previous file with comments | « chrome/browser/resources/net_internals/http_throttling_view.html ('k') | chrome/browser/resources/net_internals/index.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698