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

Side by Side Diff: Source/devtools/front_end/resources/ApplicationCacheItemsView.js

Issue 722713002: DevTools: get rid of getters and setters in StatusBarButton. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 1 month 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
1 /* 1 /*
2 * Copyright (C) 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2010 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 20 matching lines...) Expand all
31 { 31 {
32 WebInspector.VBox.call(this); 32 WebInspector.VBox.call(this);
33 33
34 this._model = model; 34 this._model = model;
35 35
36 this.element.classList.add("storage-view"); 36 this.element.classList.add("storage-view");
37 this.element.classList.add("table"); 37 this.element.classList.add("table");
38 38
39 // FIXME: Needs better tooltip. (Localized) 39 // FIXME: Needs better tooltip. (Localized)
40 this.deleteButton = new WebInspector.StatusBarButton(WebInspector.UIString(" Delete"), "delete-storage-status-bar-item"); 40 this.deleteButton = new WebInspector.StatusBarButton(WebInspector.UIString(" Delete"), "delete-storage-status-bar-item");
41 this.deleteButton.visible = false; 41 this.deleteButton.setVisible(false);
42 this.deleteButton.addEventListener("click", this._deleteButtonClicked, this) ; 42 this.deleteButton.addEventListener("click", this._deleteButtonClicked, this) ;
43 43
44 this.connectivityIcon = createElement("div"); 44 this.connectivityIcon = createElement("div");
45 this.connectivityMessage = createElement("span"); 45 this.connectivityMessage = createElement("span");
46 this.connectivityMessage.className = "storage-application-cache-connectivity "; 46 this.connectivityMessage.className = "storage-application-cache-connectivity ";
47 this.connectivityMessage.textContent = ""; 47 this.connectivityMessage.textContent = "";
48 48
49 this.divider = createElement("span"); 49 this.divider = createElement("span");
50 this.divider.className = "status-bar-item status-bar-divider"; 50 this.divider.className = "status-bar-item status-bar-divider";
51 51
(...skipping 29 matching lines...) Expand all
81 ]; 81 ];
82 }, 82 },
83 83
84 wasShown: function() 84 wasShown: function()
85 { 85 {
86 this._maybeUpdate(); 86 this._maybeUpdate();
87 }, 87 },
88 88
89 willHide: function() 89 willHide: function()
90 { 90 {
91 this.deleteButton.visible = false; 91 this.deleteButton.setVisible(false);
92 }, 92 },
93 93
94 _maybeUpdate: function() 94 _maybeUpdate: function()
95 { 95 {
96 if (!this.isShowing() || !this._viewDirty) 96 if (!this.isShowing() || !this._viewDirty)
97 return; 97 return;
98 98
99 this._update(); 99 this._update();
100 this._viewDirty = false; 100 this._viewDirty = false;
101 }, 101 },
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 _updateCallback: function(applicationCache) 157 _updateCallback: function(applicationCache)
158 { 158 {
159 if (!applicationCache || !applicationCache.manifestURL) { 159 if (!applicationCache || !applicationCache.manifestURL) {
160 delete this._manifest; 160 delete this._manifest;
161 delete this._creationTime; 161 delete this._creationTime;
162 delete this._updateTime; 162 delete this._updateTime;
163 delete this._size; 163 delete this._size;
164 delete this._resources; 164 delete this._resources;
165 165
166 this._emptyView.show(this.element); 166 this._emptyView.show(this.element);
167 this.deleteButton.visible = false; 167 this.deleteButton.setVisible(false);
168 if (this._dataGrid) 168 if (this._dataGrid)
169 this._dataGrid.element.classList.add("hidden"); 169 this._dataGrid.element.classList.add("hidden");
170 return; 170 return;
171 } 171 }
172 // FIXME: are these variables needed anywhere else? 172 // FIXME: are these variables needed anywhere else?
173 this._manifest = applicationCache.manifestURL; 173 this._manifest = applicationCache.manifestURL;
174 this._creationTime = applicationCache.creationTime; 174 this._creationTime = applicationCache.creationTime;
175 this._updateTime = applicationCache.updateTime; 175 this._updateTime = applicationCache.updateTime;
176 this._size = applicationCache.size; 176 this._size = applicationCache.size;
177 this._resources = applicationCache.resources; 177 this._resources = applicationCache.resources;
178 178
179 if (!this._dataGrid) 179 if (!this._dataGrid)
180 this._createDataGrid(); 180 this._createDataGrid();
181 181
182 this._populateDataGrid(); 182 this._populateDataGrid();
183 this._dataGrid.autoSizeColumns(20, 80); 183 this._dataGrid.autoSizeColumns(20, 80);
184 this._dataGrid.element.classList.remove("hidden"); 184 this._dataGrid.element.classList.remove("hidden");
185 this._emptyView.detach(); 185 this._emptyView.detach();
186 this.deleteButton.visible = true; 186 this.deleteButton.setVisible(true);
187 187
188 // FIXME: For Chrome, put creationTime and updateTime somewhere. 188 // FIXME: For Chrome, put creationTime and updateTime somewhere.
189 // NOTE: localizedString has not yet been added. 189 // NOTE: localizedString has not yet been added.
190 // WebInspector.UIString("(%s) Created: %s Updated: %s", this._size, thi s._creationTime, this._updateTime); 190 // WebInspector.UIString("(%s) Created: %s Updated: %s", this._size, thi s._creationTime, this._updateTime);
191 }, 191 },
192 192
193 _createDataGrid: function() 193 _createDataGrid: function()
194 { 194 {
195 var columns = [ 195 var columns = [
196 {title: WebInspector.UIString("Resource"), sort: WebInspector.DataGr id.Order.Ascending, sortable: true}, 196 {title: WebInspector.UIString("Resource"), sort: WebInspector.DataGr id.Order.Ascending, sortable: true},
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 _deleteCallback: function(node) 260 _deleteCallback: function(node)
261 { 261 {
262 // FIXME: Should we delete a single (selected) resource or all resources ? 262 // FIXME: Should we delete a single (selected) resource or all resources ?
263 // InspectorBackend.deleteCachedResource(...) 263 // InspectorBackend.deleteCachedResource(...)
264 // this._update(); 264 // this._update();
265 }, 265 },
266 266
267 __proto__: WebInspector.VBox.prototype 267 __proto__: WebInspector.VBox.prototype
268 } 268 }
269 269
OLDNEW
« no previous file with comments | « Source/devtools/front_end/promises/PromisePane.js ('k') | Source/devtools/front_end/resources/CookieItemsView.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698