OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 /** | 5 /** |
6 * This view displays information on the HTTP cache. | 6 * This view displays information on the HTTP cache. |
7 */ | 7 */ |
| 8 var HttpCacheView = (function() { |
| 9 'use strict'; |
8 | 10 |
9 var HttpCacheView = (function() { | |
10 // IDs for special HTML elements in http_cache_view.html | 11 // IDs for special HTML elements in http_cache_view.html |
11 const MAIN_BOX_ID = 'http-cache-view-tab-content'; | 12 var MAIN_BOX_ID = 'http-cache-view-tab-content'; |
12 const STATS_DIV_ID = 'http-cache-view-cache-stats'; | 13 var STATS_DIV_ID = 'http-cache-view-cache-stats'; |
13 | 14 |
14 // We inherit from DivView. | 15 // We inherit from DivView. |
15 var superClass = DivView; | 16 var superClass = DivView; |
16 | 17 |
17 /** | 18 /** |
18 * @constructor | 19 * @constructor |
19 */ | 20 */ |
20 function HttpCacheView() { | 21 function HttpCacheView() { |
| 22 assertFirstConstructorCall(HttpCacheView); |
| 23 |
21 // Call superclass's constructor. | 24 // Call superclass's constructor. |
22 superClass.call(this, MAIN_BOX_ID); | 25 superClass.call(this, MAIN_BOX_ID); |
23 | 26 |
24 this.statsDiv_ = $(STATS_DIV_ID); | 27 this.statsDiv_ = $(STATS_DIV_ID); |
25 | 28 |
26 // Register to receive http cache info. | 29 // Register to receive http cache info. |
27 g_browser.addHttpCacheInfoObserver(this); | 30 g_browser.addHttpCacheInfoObserver(this); |
28 } | 31 } |
29 | 32 |
30 cr.addSingletonGetter(HttpCacheView); | 33 cr.addSingletonGetter(HttpCacheView); |
(...skipping 17 matching lines...) Expand all Loading... |
48 for (var statName in info.stats) { | 51 for (var statName in info.stats) { |
49 var li = addNode(statsUl, 'li'); | 52 var li = addNode(statsUl, 'li'); |
50 addTextNode(li, statName + ': ' + info.stats[statName]); | 53 addTextNode(li, statName + ': ' + info.stats[statName]); |
51 } | 54 } |
52 return true; | 55 return true; |
53 } | 56 } |
54 }; | 57 }; |
55 | 58 |
56 return HttpCacheView; | 59 return HttpCacheView; |
57 })(); | 60 })(); |
OLD | NEW |