OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 * @constructor | 6 * @constructor |
7 * @extends {WebInspector.VBox} | 7 * @extends {WebInspector.VBoxWithToolbarItems} |
8 * @param {!WebInspector.ServiceWorkerCacheModel} model | 8 * @param {!WebInspector.ServiceWorkerCacheModel} model |
9 * @param {!WebInspector.ServiceWorkerCacheModel.Cache} cache | 9 * @param {!WebInspector.ServiceWorkerCacheModel.Cache} cache |
10 */ | 10 */ |
11 WebInspector.ServiceWorkerCacheView = function(model, cache) | 11 WebInspector.ServiceWorkerCacheView = function(model, cache) |
12 { | 12 { |
13 WebInspector.VBox.call(this); | 13 WebInspector.VBoxWithToolbarItems.call(this); |
14 this.registerRequiredCSS("resources/serviceWorkerCacheViews.css"); | 14 this.registerRequiredCSS("resources/serviceWorkerCacheViews.css"); |
15 | 15 |
16 this._model = model; | 16 this._model = model; |
17 | 17 |
18 this.element.classList.add("service-worker-cache-data-view"); | 18 this.element.classList.add("service-worker-cache-data-view"); |
19 this.element.classList.add("storage-view"); | 19 this.element.classList.add("storage-view"); |
20 | 20 |
21 this._createEditorToolbar(); | 21 this._createEditorToolbar(); |
22 | 22 |
23 this._refreshButton = new WebInspector.ToolbarButton(WebInspector.UIString("
Refresh"), "refresh-toolbar-item"); | 23 this._refreshButton = new WebInspector.ToolbarButton(WebInspector.UIString("
Refresh"), "refresh-toolbar-item"); |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 this._lastSkipCount = skipCount; | 138 this._lastSkipCount = skipCount; |
139 this._model.loadCacheData(this._cache, skipCount, pageSize, this._update
DataCallback.bind(this, skipCount)); | 139 this._model.loadCacheData(this._cache, skipCount, pageSize, this._update
DataCallback.bind(this, skipCount)); |
140 }, | 140 }, |
141 | 141 |
142 _refreshButtonClicked: function(event) | 142 _refreshButtonClicked: function(event) |
143 { | 143 { |
144 this._updateData(true); | 144 this._updateData(true); |
145 }, | 145 }, |
146 | 146 |
147 /** | 147 /** |
| 148 * @override |
148 * @return {!Array.<!WebInspector.ToolbarItem>} | 149 * @return {!Array.<!WebInspector.ToolbarItem>} |
149 */ | 150 */ |
150 toolbarItems: function() | 151 toolbarItems: function() |
151 { | 152 { |
152 return [this._refreshButton]; | 153 return [this._refreshButton]; |
153 }, | 154 }, |
154 | 155 |
155 clear: function() | 156 clear: function() |
156 { | 157 { |
157 this._dataGrid.rootNode().removeChildren(); | 158 this._dataGrid.rootNode().removeChildren(); |
158 this._entries = []; | 159 this._entries = []; |
159 }, | 160 }, |
160 | 161 |
161 __proto__: WebInspector.VBox.prototype | 162 __proto__: WebInspector.VBoxWithToolbarItems.prototype |
162 } | 163 } |
OLD | NEW |