Index: chrome_linux64/resources/inspector/ResourcesPanel.js |
=================================================================== |
--- chrome_linux64/resources/inspector/ResourcesPanel.js (revision 273864) |
+++ chrome_linux64/resources/inspector/ResourcesPanel.js (working copy) |
@@ -1,5 +1,5 @@ |
WebInspector.ApplicationCacheItemsView=function(model,frameId) |
-{WebInspector.View.call(this);this._model=model;this.element.classList.add("storage-view");this.element.classList.add("table");this.deleteButton=new WebInspector.StatusBarButton(WebInspector.UIString("Delete"),"delete-storage-status-bar-item");this.deleteButton.visible=false;this.deleteButton.addEventListener("click",this._deleteButtonClicked,this);this.connectivityIcon=document.createElement("div");this.connectivityMessage=document.createElement("span");this.connectivityMessage.className="storage-application-cache-connectivity";this.connectivityMessage.textContent="";this.divider=document.createElement("span");this.divider.className="status-bar-item status-bar-divider";this.statusIcon=document.createElement("div");this.statusMessage=document.createElement("span");this.statusMessage.className="storage-application-cache-status";this.statusMessage.textContent="";this._frameId=frameId;this._emptyView=new WebInspector.EmptyView(WebInspector.UIString("No Application Cache information available."));this._emptyView.show(this.element);this._markDirty();var status=this._model.frameManifestStatus(frameId);this.updateStatus(status);this.updateNetworkState(this._model.onLine);this.deleteButton.element.style.display="none";} |
+{WebInspector.VBox.call(this);this._model=model;this.element.classList.add("storage-view");this.element.classList.add("table");this.deleteButton=new WebInspector.StatusBarButton(WebInspector.UIString("Delete"),"delete-storage-status-bar-item");this.deleteButton.visible=false;this.deleteButton.addEventListener("click",this._deleteButtonClicked,this);this.connectivityIcon=document.createElement("div");this.connectivityMessage=document.createElement("span");this.connectivityMessage.className="storage-application-cache-connectivity";this.connectivityMessage.textContent="";this.divider=document.createElement("span");this.divider.className="status-bar-item status-bar-divider";this.statusIcon=document.createElement("div");this.statusMessage=document.createElement("span");this.statusMessage.className="storage-application-cache-status";this.statusMessage.textContent="";this._frameId=frameId;this._emptyView=new WebInspector.EmptyView(WebInspector.UIString("No Application Cache information available."));this._emptyView.show(this.element);this._markDirty();var status=this._model.frameManifestStatus(frameId);this.updateStatus(status);this.updateNetworkState(this._model.onLine);this.deleteButton.element.style.display="none";} |
WebInspector.ApplicationCacheItemsView.prototype={get statusBarItems() |
{return[this.deleteButton.element,this.connectivityIcon,this.connectivityMessage,this.divider,this.statusIcon,this.statusMessage];},wasShown:function() |
{this._maybeUpdate();},willHide:function() |
@@ -20,14 +20,14 @@ |
{return sortDirection*(resource1[field]-resource2[field]);} |
function localeCompare(field,resource1,resource2) |
{return sortDirection*(resource1[field]+"").localeCompare(resource2[field]+"")} |
-var comparator;switch(parseInt(this._dataGrid.sortColumnIdentifier(),10)){case 0:comparator=localeCompare.bind(this,"name");break;case 1:comparator=localeCompare.bind(this,"type");break;case 2:comparator=numberCompare.bind(this,"size");break;default:localeCompare.bind(this,"resource");} |
+var comparator;switch(parseInt(this._dataGrid.sortColumnIdentifier(),10)){case 0:comparator=localeCompare.bind(null,"name");break;case 1:comparator=localeCompare.bind(null,"type");break;case 2:comparator=numberCompare.bind(null,"size");break;default:localeCompare.bind(null,"resource");} |
this._resources.sort(comparator);this._dataGrid.rootNode().removeChildren();var nodeToSelect;for(var i=0;i<this._resources.length;++i){var data={};var resource=this._resources[i];data[0]=resource.url;data[1]=resource.type;data[2]=Number.bytesToString(resource.size);var node=new WebInspector.DataGridNode(data);node.resource=resource;node.selectable=true;this._dataGrid.rootNode().appendChild(node);if(resource===selectedResource){nodeToSelect=node;nodeToSelect.selected=true;}} |
if(!nodeToSelect&&this._dataGrid.rootNode().children.length) |
this._dataGrid.rootNode().children[0].selected=true;},_deleteButtonClicked:function(event) |
{if(!this._dataGrid||!this._dataGrid.selectedNode) |
return;this._deleteCallback(this._dataGrid.selectedNode);},_deleteCallback:function(node) |
-{},__proto__:WebInspector.View.prototype};WebInspector.DOMStorageItemsView=function(domStorage) |
-{WebInspector.View.call(this);this.domStorage=domStorage;this.element.classList.add("storage-view");this.element.classList.add("table");this.deleteButton=new WebInspector.StatusBarButton(WebInspector.UIString("Delete"),"delete-storage-status-bar-item");this.deleteButton.visible=false;this.deleteButton.addEventListener("click",this._deleteButtonClicked,this);this.refreshButton=new WebInspector.StatusBarButton(WebInspector.UIString("Refresh"),"refresh-storage-status-bar-item");this.refreshButton.addEventListener("click",this._refreshButtonClicked,this);this.domStorage.addEventListener(WebInspector.DOMStorage.Events.DOMStorageItemsCleared,this._domStorageItemsCleared,this);this.domStorage.addEventListener(WebInspector.DOMStorage.Events.DOMStorageItemRemoved,this._domStorageItemRemoved,this);this.domStorage.addEventListener(WebInspector.DOMStorage.Events.DOMStorageItemAdded,this._domStorageItemAdded,this);this.domStorage.addEventListener(WebInspector.DOMStorage.Events.DOMStorageItemUpdated,this._domStorageItemUpdated,this);} |
+{},__proto__:WebInspector.VBox.prototype};WebInspector.DOMStorageItemsView=function(domStorage) |
+{WebInspector.VBox.call(this);this.domStorage=domStorage;this.element.classList.add("storage-view");this.element.classList.add("table");this.deleteButton=new WebInspector.StatusBarButton(WebInspector.UIString("Delete"),"delete-storage-status-bar-item");this.deleteButton.visible=false;this.deleteButton.addEventListener("click",this._deleteButtonClicked,this);this.refreshButton=new WebInspector.StatusBarButton(WebInspector.UIString("Refresh"),"refresh-storage-status-bar-item");this.refreshButton.addEventListener("click",this._refreshButtonClicked,this);this.domStorage.addEventListener(WebInspector.DOMStorage.Events.DOMStorageItemsCleared,this._domStorageItemsCleared,this);this.domStorage.addEventListener(WebInspector.DOMStorage.Events.DOMStorageItemRemoved,this._domStorageItemRemoved,this);this.domStorage.addEventListener(WebInspector.DOMStorage.Events.DOMStorageItemAdded,this._domStorageItemAdded,this);this.domStorage.addEventListener(WebInspector.DOMStorage.Events.DOMStorageItemUpdated,this._domStorageItemUpdated,this);} |
WebInspector.DOMStorageItemsView.prototype={get statusBarItems() |
{return[this.refreshButton.element,this.deleteButton.element];},wasShown:function() |
{this._update();},willHide:function() |
@@ -61,8 +61,8 @@ |
rootNode.removeChild(childNode);}},_deleteCallback:function(node) |
{if(!node||node.isCreationNode) |
return;if(this.domStorage) |
-this.domStorage.removeItem(node.data.key);},__proto__:WebInspector.View.prototype};WebInspector.DatabaseQueryView=function(database) |
-{WebInspector.View.call(this);this.database=database;this.element.classList.add("storage-view");this.element.classList.add("query");this.element.classList.add("monospace");this.element.addEventListener("selectstart",this._selectStart.bind(this),false);this._promptElement=document.createElement("div");this._promptElement.className="database-query-prompt";this._promptElement.appendChild(document.createElement("br"));this._promptElement.addEventListener("keydown",this._promptKeyDown.bind(this),true);this.element.appendChild(this._promptElement);this.prompt=new WebInspector.TextPromptWithHistory(this.completions.bind(this)," ");this.prompt.attach(this._promptElement);this.element.addEventListener("click",this._messagesClicked.bind(this),true);} |
+this.domStorage.removeItem(node.data.key);},__proto__:WebInspector.VBox.prototype};WebInspector.DatabaseQueryView=function(database) |
+{WebInspector.VBox.call(this);this.database=database;this.element.classList.add("storage-view");this.element.classList.add("query");this.element.classList.add("monospace");this.element.addEventListener("selectstart",this._selectStart.bind(this),false);this._promptElement=document.createElement("div");this._promptElement.className="database-query-prompt";this._promptElement.appendChild(document.createElement("br"));this._promptElement.addEventListener("keydown",this._promptKeyDown.bind(this),true);this.element.appendChild(this._promptElement);this.prompt=new WebInspector.TextPromptWithHistory(this.completions.bind(this)," ");this.prompt.attach(this._promptElement);this.element.addEventListener("click",this._messagesClicked.bind(this),true);} |
WebInspector.DatabaseQueryView.Events={SchemaUpdated:"SchemaUpdated"} |
WebInspector.DatabaseQueryView.prototype={_messagesClicked:function() |
{if(!this.prompt.isCaretInsidePrompt()&&window.getSelection().isCollapsed) |
@@ -90,8 +90,8 @@ |
{var resultElement=this._appendQueryResult(query);view.show(resultElement);this._promptElement.scrollIntoView(false);},_appendErrorQueryResult:function(query,errorText) |
{var resultElement=this._appendQueryResult(query);resultElement.classList.add("error") |
resultElement.textContent=errorText;this._promptElement.scrollIntoView(false);},_appendQueryResult:function(query) |
-{var element=document.createElement("div");element.className="database-user-query";this.element.insertBefore(element,this.prompt.proxyElement);var commandTextElement=document.createElement("span");commandTextElement.className="database-query-text";commandTextElement.textContent=query;element.appendChild(commandTextElement);var resultElement=document.createElement("div");resultElement.className="database-query-result";element.appendChild(resultElement);return resultElement;},__proto__:WebInspector.View.prototype};WebInspector.DatabaseTableView=function(database,tableName) |
-{WebInspector.View.call(this);this.database=database;this.tableName=tableName;this.element.classList.add("storage-view");this.element.classList.add("table");this.refreshButton=new WebInspector.StatusBarButton(WebInspector.UIString("Refresh"),"refresh-storage-status-bar-item");this.refreshButton.addEventListener("click",this._refreshButtonClicked,this);} |
+{var element=document.createElement("div");element.className="database-user-query";this.element.insertBefore(element,this.prompt.proxyElement);var commandTextElement=document.createElement("span");commandTextElement.className="database-query-text";commandTextElement.textContent=query;element.appendChild(commandTextElement);var resultElement=document.createElement("div");resultElement.className="database-query-result";element.appendChild(resultElement);return resultElement;},__proto__:WebInspector.VBox.prototype};WebInspector.DatabaseTableView=function(database,tableName) |
+{WebInspector.VBox.call(this);this.database=database;this.tableName=tableName;this.element.classList.add("storage-view");this.element.classList.add("table");this.refreshButton=new WebInspector.StatusBarButton(WebInspector.UIString("Refresh"),"refresh-storage-status-bar-item");this.refreshButton.addEventListener("click",this._refreshButtonClicked,this);} |
WebInspector.DatabaseTableView.prototype={wasShown:function() |
{this.update();},get statusBarItems() |
{return[this.refreshButton.element];},_escapeTableName:function(tableName) |
@@ -100,7 +100,7 @@ |
{this.detachChildViews();this.element.removeChildren();var dataGrid=WebInspector.DataGrid.createSortableDataGrid(columnNames,values);if(!dataGrid){this._emptyView=new WebInspector.EmptyView(WebInspector.UIString("The ā%sā\ntable is empty.",this.tableName));this._emptyView.show(this.element);return;} |
dataGrid.show(this.element);dataGrid.autoSizeColumns(5);},_queryError:function(error) |
{this.detachChildViews();this.element.removeChildren();var errorMsgElement=document.createElement("div");errorMsgElement.className="storage-table-error";errorMsgElement.textContent=WebInspector.UIString("An error occurred trying to\nread the ā%sā table.",this.tableName);this.element.appendChild(errorMsgElement);},_refreshButtonClicked:function(event) |
-{this.update();},__proto__:WebInspector.View.prototype};WebInspector.DirectoryContentView=function() |
+{this.update();},__proto__:WebInspector.VBox.prototype};WebInspector.DirectoryContentView=function() |
{const indexes=WebInspector.DirectoryContentView.columnIndexes;var columns=[{id:indexes.Name,title:WebInspector.UIString("Name"),sortable:true,sort:WebInspector.DataGrid.Order.Ascending,width:"20%"},{id:indexes.URL,title:WebInspector.UIString("URL"),sortable:true,width:"20%"},{id:indexes.Type,title:WebInspector.UIString("Type"),sortable:true,width:"15%"},{id:indexes.Size,title:WebInspector.UIString("Size"),sortable:true,width:"10%"},{id:indexes.ModificationTime,title:WebInspector.UIString("Modification Time"),sortable:true,width:"25%"}];WebInspector.DataGrid.call(this,columns);this.addEventListener(WebInspector.DataGrid.Events.SortingChanged,this._sort,this);} |
WebInspector.DirectoryContentView.columnIndexes={Name:"0",URL:"1",Type:"2",Size:"3",ModificationTime:"4"} |
WebInspector.DirectoryContentView.prototype={showEntries:function(entries) |
@@ -131,13 +131,13 @@ |
return;this._metadata=metadata;var data=this.data;if(this._entry.isDirectory) |
data[indexes.Size]=WebInspector.UIString("-");else |
data[indexes.Size]=Number.bytesToString(metadata.size);data[indexes.ModificationTime]=new Date(metadata.modificationTime).toGMTString();this.data=data;},__proto__:WebInspector.DataGridNode.prototype};WebInspector.IDBDatabaseView=function(database) |
-{WebInspector.View.call(this);this.registerRequiredCSS("indexedDBViews.css");this.element.classList.add("fill");this.element.classList.add("indexed-db-database-view");this._headersListElement=this.element.createChild("ol","outline-disclosure");this._headersTreeOutline=new TreeOutline(this._headersListElement);this._headersTreeOutline.expandTreeElementsWhenArrowing=true;this._securityOriginTreeElement=new TreeElement("",null,false);this._securityOriginTreeElement.selectable=false;this._headersTreeOutline.appendChild(this._securityOriginTreeElement);this._nameTreeElement=new TreeElement("",null,false);this._nameTreeElement.selectable=false;this._headersTreeOutline.appendChild(this._nameTreeElement);this._intVersionTreeElement=new TreeElement("",null,false);this._intVersionTreeElement.selectable=false;this._headersTreeOutline.appendChild(this._intVersionTreeElement);this._stringVersionTreeElement=new TreeElement("",null,false);this._stringVersionTreeElement.selectable=false;this._headersTreeOutline.appendChild(this._stringVersionTreeElement);this.update(database);} |
+{WebInspector.VBox.call(this);this.registerRequiredCSS("indexedDBViews.css");this.element.classList.add("indexed-db-database-view");this._headersListElement=this.element.createChild("ol","outline-disclosure");this._headersTreeOutline=new TreeOutline(this._headersListElement);this._headersTreeOutline.expandTreeElementsWhenArrowing=true;this._securityOriginTreeElement=new TreeElement("",null,false);this._securityOriginTreeElement.selectable=false;this._headersTreeOutline.appendChild(this._securityOriginTreeElement);this._nameTreeElement=new TreeElement("",null,false);this._nameTreeElement.selectable=false;this._headersTreeOutline.appendChild(this._nameTreeElement);this._intVersionTreeElement=new TreeElement("",null,false);this._intVersionTreeElement.selectable=false;this._headersTreeOutline.appendChild(this._intVersionTreeElement);this._stringVersionTreeElement=new TreeElement("",null,false);this._stringVersionTreeElement.selectable=false;this._headersTreeOutline.appendChild(this._stringVersionTreeElement);this.update(database);} |
WebInspector.IDBDatabaseView.prototype={_formatHeader:function(name,value) |
{var fragment=document.createDocumentFragment();fragment.createChild("div","attribute-name").textContent=name+":";fragment.createChild("div","attribute-value source-code").textContent=value;return fragment;},_refreshDatabase:function() |
{this._securityOriginTreeElement.title=this._formatHeader(WebInspector.UIString("Security origin"),this._database.databaseId.securityOrigin);this._nameTreeElement.title=this._formatHeader(WebInspector.UIString("Name"),this._database.databaseId.name);this._stringVersionTreeElement.title=this._formatHeader(WebInspector.UIString("String Version"),this._database.version);this._intVersionTreeElement.title=this._formatHeader(WebInspector.UIString("Integer Version"),this._database.intVersion);},update:function(database) |
-{this._database=database;this._refreshDatabase();},__proto__:WebInspector.View.prototype} |
+{this._database=database;this._refreshDatabase();},__proto__:WebInspector.VBox.prototype} |
WebInspector.IDBDataView=function(model,databaseId,objectStore,index) |
-{WebInspector.View.call(this);this.registerRequiredCSS("indexedDBViews.css");this._model=model;this._databaseId=databaseId;this._isIndex=!!index;this.element.classList.add("indexed-db-data-view");var editorToolbar=this._createEditorToolbar();this.element.appendChild(editorToolbar);this._dataGridContainer=this.element.createChild("div","fill");this._dataGridContainer.classList.add("data-grid-container");this._refreshButton=new WebInspector.StatusBarButton(WebInspector.UIString("Refresh"),"refresh-storage-status-bar-item");this._refreshButton.addEventListener("click",this._refreshButtonClicked,this);this._clearButton=new WebInspector.StatusBarButton(WebInspector.UIString("Clear object store"),"clear-storage-status-bar-item");this._clearButton.addEventListener("click",this._clearButtonClicked,this);this._pageSize=50;this._skipCount=0;this.update(objectStore,index);this._entries=[];} |
+{WebInspector.VBox.call(this);this.registerRequiredCSS("indexedDBViews.css");this._model=model;this._databaseId=databaseId;this._isIndex=!!index;this.element.classList.add("indexed-db-data-view");var editorToolbar=this._createEditorToolbar();this.element.appendChild(editorToolbar);this._dataGridContainer=this.element.createChild("div","fill");this._dataGridContainer.classList.add("data-grid-container");this._refreshButton=new WebInspector.StatusBarButton(WebInspector.UIString("Refresh"),"refresh-storage-status-bar-item");this._refreshButton.addEventListener("click",this._refreshButtonClicked,this);this._clearButton=new WebInspector.StatusBarButton(WebInspector.UIString("Clear object store"),"clear-storage-status-bar-item");this._clearButton.addEventListener("click",this._clearButtonClicked,this);this._pageSize=50;this._skipCount=0;this.update(objectStore,index);this._entries=[];} |
WebInspector.IDBDataView.prototype={_createDataGrid:function() |
{var keyPath=this._isIndex?this._index.keyPath:this._objectStore.keyPath;var columns=[];columns.push({id:"number",title:WebInspector.UIString("#"),width:"50px"});columns.push({id:"key",titleDOMFragment:this._keyColumnHeaderFragment(WebInspector.UIString("Key"),keyPath)});if(this._isIndex) |
columns.push({id:"primaryKey",titleDOMFragment:this._keyColumnHeaderFragment(WebInspector.UIString("Primary key"),this._objectStore.keyPath)});columns.push({id:"value",title:WebInspector.UIString("Value")});var dataGrid=new WebInspector.DataGrid(columns);return dataGrid;},_keyColumnHeaderFragment:function(prefix,keyPath) |
@@ -154,9 +154,7 @@ |
{this._objectStore=objectStore;this._index=index;if(this._dataGrid) |
this._dataGrid.detach();this._dataGrid=this._createDataGrid();this._dataGrid.show(this._dataGridContainer);this._skipCount=0;this._updateData(true);},_parseKey:function(keyString) |
{var result;try{result=JSON.parse(keyString);}catch(e){result=keyString;} |
-return result;},_stringifyKey:function(key) |
-{if(typeof(key)==="string") |
-return key;return JSON.stringify(key);},_updateData:function(force) |
+return result;},_updateData:function(force) |
{var key=this._parseKey(this._keyInputElement.value);var pageSize=this._pageSize;var skipCount=this._skipCount;this._refreshButton.setEnabled(false);this._clearButton.setEnabled(!this._isIndex);if(!force&&this._lastKey===key&&this._lastPageSize===pageSize&&this._lastSkipCount===skipCount) |
return;if(this._lastKey!==key||this._lastPageSize!==pageSize){skipCount=0;this._skipCount=0;} |
this._lastKey=key;this._lastPageSize=pageSize;this._lastSkipCount=skipCount;function callback(entries,hasMore) |
@@ -170,7 +168,7 @@ |
this._clearButton.setEnabled(false);this._model.clearObjectStore(this._databaseId,this._objectStore.name,cleared.bind(this));},get statusBarItems() |
{return[this._refreshButton.element,this._clearButton.element];},clear:function() |
{this._dataGrid.rootNode().removeChildren();for(var i=0;i<this._entries.length;++i){this._entries[i].key.release();this._entries[i].primaryKey.release();this._entries[i].value.release();} |
-this._entries=[];},__proto__:WebInspector.View.prototype} |
+this._entries=[];},__proto__:WebInspector.VBox.prototype} |
WebInspector.IDBDataGridNode=function(data) |
{WebInspector.DataGridNode.call(this,data,false);this.selectable=false;} |
WebInspector.IDBDataGridNode.prototype={createCell:function(columnIdentifier) |
@@ -178,7 +176,7 @@ |
return cell;},_formatValue:function(cell,value) |
{var type=value.subtype||value.type;var contents=cell.createChild("div","source-code console-formatted-"+type);switch(type){case"object":case"array":var section=new WebInspector.ObjectPropertiesSection(value,value.description) |
section.editable=false;section.skipProto=true;contents.appendChild(section.element);break;case"string":contents.classList.add("primitive-value");contents.appendChild(document.createTextNode("\""+value.description+"\""));break;default:contents.classList.add("primitive-value");contents.appendChild(document.createTextNode(value.description));}},__proto__:WebInspector.DataGridNode.prototype};WebInspector.FileContentView=function(file) |
-{WebInspector.View.call(this);this._innerView=(null);this._file=file;this._content=null;} |
+{WebInspector.VBox.call(this);this._innerView=(null);this._file=file;this._content=null;} |
WebInspector.FileContentView.prototype={wasShown:function() |
{if(!this._innerView){if(this._file.isTextFile) |
this._innerView=new WebInspector.EmptyView("");else |
@@ -189,7 +187,7 @@ |
return;var sourceFrame=(this._innerView);this._content.requestContent(sourceFrame.setContent.bind(sourceFrame));}else{this._innerView.detach();this._content=new WebInspector.FileContentView.FileContentProvider(this._file,metadata);var sourceFrame=new WebInspector.SourceFrame(this._content);sourceFrame.setHighlighterType(this._file.resourceType.canonicalMimeType());this._innerView=sourceFrame;this._innerView.show(this.element);}},refresh:function() |
{if(!this._innerView) |
return;if(this._file.isTextFile) |
-this._file.requestMetadata(this._metadataReceived.bind(this));},__proto__:WebInspector.View.prototype} |
+this._file.requestMetadata(this._metadataReceived.bind(this));},__proto__:WebInspector.VBox.prototype} |
WebInspector.FileContentView.FileContentProvider=function(file,metadata) |
{this._file=file;this._metadata=metadata;} |
WebInspector.FileContentView.FileContentProvider.prototype={contentURL:function() |
@@ -201,17 +199,17 @@ |
{setTimeout(callback.bind(null,[]),0);},updateMetadata:function(metadata) |
{if(this._metadata.modificationTime>=metadata.modificationTime) |
return false;this._metadata=metadata.modificationTime;return true;}};WebInspector.FileSystemView=function(fileSystem) |
-{WebInspector.SidebarView.call(this,WebInspector.SidebarView.SidebarPosition.Start,"FileSystemViewSidebarWidth");this.element.classList.add("file-system-view");this.element.classList.add("storage-view");var directoryTreeElement=this.element.createChild("ol","filesystem-directory-tree");this._directoryTree=new TreeOutline(directoryTreeElement);this.firstElement().appendChild(directoryTreeElement);this.firstElement().classList.add("outline-disclosure","sidebar");var rootItem=new WebInspector.FileSystemView.EntryTreeElement(this,fileSystem.root);rootItem.expanded=true;this._directoryTree.appendChild(rootItem);this._visibleView=null;this._refreshButton=new WebInspector.StatusBarButton(WebInspector.UIString("Refresh"),"refresh-storage-status-bar-item");this._refreshButton.visible=true;this._refreshButton.addEventListener("click",this._refresh,this);this._deleteButton=new WebInspector.StatusBarButton(WebInspector.UIString("Delete"),"delete-storage-status-bar-item");this._deleteButton.visible=true;this._deleteButton.addEventListener("click",this._confirmDelete,this);} |
+{WebInspector.SplitView.call(this,true,false,"fileSystemViewSplitViewState");this.element.classList.add("file-system-view");this.element.classList.add("storage-view");var directoryTreeElement=this.element.createChild("ol","filesystem-directory-tree");this._directoryTree=new TreeOutline(directoryTreeElement);this.sidebarElement().appendChild(directoryTreeElement);this.sidebarElement().classList.add("outline-disclosure","sidebar");var rootItem=new WebInspector.FileSystemView.EntryTreeElement(this,fileSystem.root);rootItem.expanded=true;this._directoryTree.appendChild(rootItem);this._visibleView=null;this._refreshButton=new WebInspector.StatusBarButton(WebInspector.UIString("Refresh"),"refresh-storage-status-bar-item");this._refreshButton.visible=true;this._refreshButton.addEventListener("click",this._refresh,this);this._deleteButton=new WebInspector.StatusBarButton(WebInspector.UIString("Delete"),"delete-storage-status-bar-item");this._deleteButton.visible=true;this._deleteButton.addEventListener("click",this._confirmDelete,this);} |
WebInspector.FileSystemView.prototype={get statusBarItems() |
{return[this._refreshButton.element,this._deleteButton.element];},get visibleView() |
{return this._visibleView;},showView:function(view) |
{if(this._visibleView===view) |
return;if(this._visibleView) |
-this._visibleView.detach();this._visibleView=view;this.setMainView(view);},_refresh:function() |
+this._visibleView.detach();this._visibleView=view;view.show(this.mainElement());},_refresh:function() |
{this._directoryTree.children[0].refresh();},_confirmDelete:function() |
{if(confirm(WebInspector.UIString("Are you sure you want to delete the selected entry?"))) |
this._delete();},_delete:function() |
-{this._directoryTree.selectedTreeElement.deleteEntry();},__proto__:WebInspector.SidebarView.prototype} |
+{this._directoryTree.selectedTreeElement.deleteEntry();},__proto__:WebInspector.SplitView.prototype} |
WebInspector.FileSystemView.EntryTreeElement=function(fileSystemView,entry) |
{TreeElement.call(this,entry.name,null,entry.isDirectory);this._entry=entry;this._fileSystemView=fileSystemView;} |
WebInspector.FileSystemView.EntryTreeElement.prototype={onattach:function() |
@@ -237,10 +235,11 @@ |
{this._entry.deleteEntry(this._deletionCompleted.bind(this));},_deletionCompleted:function() |
{if(this._entry!=this._entry.fileSystem.root) |
this.parent.refresh();},__proto__:TreeElement.prototype};WebInspector.ResourcesPanel=function(database) |
-{WebInspector.Panel.call(this,"resources");this.registerRequiredCSS("resourcesPanel.css");WebInspector.settings.resourcesLastSelectedItem=WebInspector.settings.createSetting("resourcesLastSelectedItem",{});this.createSidebarViewWithTree();this.splitView.sidebarElement().classList.add("outline-disclosure","filter-all","children","small");this.sidebarTreeElement.classList.remove("sidebar-tree");this.resourcesListTreeElement=new WebInspector.StorageCategoryTreeElement(this,WebInspector.UIString("Frames"),"Frames",["frame-storage-tree-item"]);this.sidebarTree.appendChild(this.resourcesListTreeElement);this.databasesListTreeElement=new WebInspector.StorageCategoryTreeElement(this,WebInspector.UIString("Web SQL"),"Databases",["database-storage-tree-item"]);this.sidebarTree.appendChild(this.databasesListTreeElement);this.indexedDBListTreeElement=new WebInspector.IndexedDBTreeElement(this);this.sidebarTree.appendChild(this.indexedDBListTreeElement);this.localStorageListTreeElement=new WebInspector.StorageCategoryTreeElement(this,WebInspector.UIString("Local Storage"),"LocalStorage",["domstorage-storage-tree-item","local-storage"]);this.sidebarTree.appendChild(this.localStorageListTreeElement);this.sessionStorageListTreeElement=new WebInspector.StorageCategoryTreeElement(this,WebInspector.UIString("Session Storage"),"SessionStorage",["domstorage-storage-tree-item","session-storage"]);this.sidebarTree.appendChild(this.sessionStorageListTreeElement);this.cookieListTreeElement=new WebInspector.StorageCategoryTreeElement(this,WebInspector.UIString("Cookies"),"Cookies",["cookie-storage-tree-item"]);this.sidebarTree.appendChild(this.cookieListTreeElement);this.applicationCacheListTreeElement=new WebInspector.StorageCategoryTreeElement(this,WebInspector.UIString("Application Cache"),"ApplicationCache",["application-cache-storage-tree-item"]);this.sidebarTree.appendChild(this.applicationCacheListTreeElement);if(WebInspector.experimentsSettings.fileSystemInspection.isEnabled()){this.fileSystemListTreeElement=new WebInspector.FileSystemListTreeElement(this);this.sidebarTree.appendChild(this.fileSystemListTreeElement);} |
-var mainElement=this.splitView.mainElement();this.storageViews=mainElement.createChild("div","resources-main");var statusBarContainer=mainElement.createChild("div","resources-status-bar");this.storageViewStatusBarItemsContainer=statusBarContainer.createChild("div","status-bar");this.storageViews.classList.add("diff-container");this._databaseTableViews=new Map();this._databaseQueryViews=new Map();this._databaseTreeElements=new Map();this._domStorageViews=new Map();this._domStorageTreeElements=new Map();this._cookieViews={};this._domains={};this.splitView.sidebarElement().addEventListener("mousemove",this._onmousemove.bind(this),false);this.splitView.sidebarElement().addEventListener("mouseout",this._onmouseout.bind(this),false);function viewGetter() |
-{return this.visibleView;} |
-WebInspector.GoToLineDialog.install(this,viewGetter.bind(this));if(WebInspector.resourceTreeModel.cachedResourcesLoaded()) |
+{WebInspector.PanelWithSidebarTree.call(this,"resources");this.registerRequiredCSS("resourcesPanel.css");WebInspector.settings.resourcesLastSelectedItem=WebInspector.settings.createSetting("resourcesLastSelectedItem",{});this.sidebarElement().classList.add("filter-all","children","small","outline-disclosure");this.sidebarTree.element.classList.remove("sidebar-tree");this.resourcesListTreeElement=new WebInspector.StorageCategoryTreeElement(this,WebInspector.UIString("Frames"),"Frames",["frame-storage-tree-item"]);this.sidebarTree.appendChild(this.resourcesListTreeElement);this.databasesListTreeElement=new WebInspector.StorageCategoryTreeElement(this,WebInspector.UIString("Web SQL"),"Databases",["database-storage-tree-item"]);this.sidebarTree.appendChild(this.databasesListTreeElement);this.indexedDBListTreeElement=new WebInspector.IndexedDBTreeElement(this);this.sidebarTree.appendChild(this.indexedDBListTreeElement);this.localStorageListTreeElement=new WebInspector.StorageCategoryTreeElement(this,WebInspector.UIString("Local Storage"),"LocalStorage",["domstorage-storage-tree-item","local-storage"]);this.sidebarTree.appendChild(this.localStorageListTreeElement);this.sessionStorageListTreeElement=new WebInspector.StorageCategoryTreeElement(this,WebInspector.UIString("Session Storage"),"SessionStorage",["domstorage-storage-tree-item","session-storage"]);this.sidebarTree.appendChild(this.sessionStorageListTreeElement);this.cookieListTreeElement=new WebInspector.StorageCategoryTreeElement(this,WebInspector.UIString("Cookies"),"Cookies",["cookie-storage-tree-item"]);this.sidebarTree.appendChild(this.cookieListTreeElement);this.applicationCacheListTreeElement=new WebInspector.StorageCategoryTreeElement(this,WebInspector.UIString("Application Cache"),"ApplicationCache",["application-cache-storage-tree-item"]);this.sidebarTree.appendChild(this.applicationCacheListTreeElement);if(WebInspector.experimentsSettings.fileSystemInspection.isEnabled()){this.fileSystemListTreeElement=new WebInspector.FileSystemListTreeElement(this);this.sidebarTree.appendChild(this.fileSystemListTreeElement);} |
+var mainView=new WebInspector.VBox();this.storageViews=mainView.element.createChild("div","resources-main diff-container");var statusBarContainer=mainView.element.createChild("div","resources-status-bar");this.storageViewStatusBarItemsContainer=statusBarContainer.createChild("div","status-bar");mainView.show(this.mainElement());this._databaseTableViews=new Map();this._databaseQueryViews=new Map();this._databaseTreeElements=new Map();this._domStorageViews=new Map();this._domStorageTreeElements=new Map();this._cookieViews={};this._domains={};this.sidebarElement().addEventListener("mousemove",this._onmousemove.bind(this),false);this.sidebarElement().addEventListener("mouseout",this._onmouseout.bind(this),false);function sourceFrameGetter() |
+{var view=this.visibleView;if(view&&view instanceof WebInspector.SourceFrame) |
+return(view);return null;} |
+WebInspector.GoToLineDialog.install(this,sourceFrameGetter.bind(this));if(WebInspector.resourceTreeModel.cachedResourcesLoaded()) |
this._cachedResourcesLoaded();WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.Load,this._loadEventFired,this);WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.CachedResourcesLoaded,this._cachedResourcesLoaded,this);WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.WillLoadCachedResources,this._resetWithFrames,this);WebInspector.databaseModel.databases().forEach(this._addDatabase.bind(this));WebInspector.databaseModel.addEventListener(WebInspector.DatabaseModel.Events.DatabaseAdded,this._databaseAdded,this);} |
WebInspector.ResourcesPanel.prototype={canSearch:function() |
{return false;},wasShown:function() |
@@ -250,7 +249,7 @@ |
{this._initDefaultSelection();},_initDefaultSelection:function() |
{if(!this._initialized) |
return;var itemURL=WebInspector.settings.resourcesLastSelectedItem.get();if(itemURL){for(var treeElement=this.sidebarTree.children[0];treeElement;treeElement=treeElement.traverseNextTreeElement(false,this.sidebarTree,true)){if(treeElement.itemURL===itemURL){treeElement.revealAndSelect(true);return;}}} |
-var mainResource=WebInspector.inspectedPageURL&&this.resourcesListTreeElement&&this.resourcesListTreeElement.expanded&&WebInspector.resourceTreeModel.resourceForURL(WebInspector.inspectedPageURL);if(mainResource) |
+var mainResource=WebInspector.resourceTreeModel.inspectedPageURL()&&this.resourcesListTreeElement&&this.resourcesListTreeElement.expanded?WebInspector.resourceTreeModel.resourceForURL(WebInspector.resourceTreeModel.inspectedPageURL()):null;if(mainResource) |
this.showResource(mainResource);},_resetWithFrames:function() |
{this.resourcesListTreeElement.removeChildren();this._treeElementForFrameId={};this._reset();},_reset:function() |
{this._domains={};var queryViews=this._databaseQueryViews.values();for(var i=0;i<queryViews.length;++i) |
@@ -289,18 +288,18 @@ |
return;var wasSelected=treeElement.selected;var parentListTreeElement=treeElement.parent;parentListTreeElement.removeChild(treeElement);if(wasSelected) |
parentListTreeElement.select();this._domStorageTreeElements.remove(treeElement);this._domStorageViews.remove(domStorage);},selectDatabase:function(database) |
{if(database){this._showDatabase(database);this._databaseTreeElements.get(database).select();}},selectDOMStorage:function(domStorage) |
-{if(domStorage){this._showDOMStorage(domStorage);this._domStorageTreeElements.get(domStorage).select();}},showAnchorLocation:function(anchor) |
-{var resource=WebInspector.resourceForURL(anchor.href);if(!resource) |
-return false;WebInspector.inspectorView.setCurrentPanel(this);this.showResource(resource,anchor.lineNumber);return true;},showResource:function(resource,line,column) |
+{if(domStorage){this._showDOMStorage(domStorage);this._domStorageTreeElements.get(domStorage).select();}},showResource:function(resource,line,column) |
{var resourceTreeElement=this._findTreeElementForResource(resource);if(resourceTreeElement) |
-resourceTreeElement.revealAndSelect(true);if(typeof line==="number"){var view=this._resourceViewForResource(resource);if(view.canHighlightPosition()) |
-view.highlightPosition(line,column);} |
+resourceTreeElement.revealAndSelect(true);if(typeof line==="number"){var resourceSourceFrame=this._resourceSourceFrameViewForResource(resource);if(resourceSourceFrame) |
+resourceSourceFrame.revealPosition(line,column,true);} |
return true;},_showResourceView:function(resource) |
{var view=this._resourceViewForResource(resource);if(!view){this.visibleView.detach();return;} |
this._innerShowView(view);},_resourceViewForResource:function(resource) |
{if(WebInspector.ResourceView.hasTextContent(resource)){var treeElement=this._findTreeElementForResource(resource);if(!treeElement) |
return null;return treeElement.sourceView();} |
-return WebInspector.ResourceView.nonSourceViewForResource(resource);},_showDatabase:function(database,tableName) |
+return WebInspector.ResourceView.nonSourceViewForResource(resource);},_resourceSourceFrameViewForResource:function(resource) |
+{var resourceView=this._resourceViewForResource(resource);if(resourceView&&resourceView instanceof WebInspector.ResourceSourceFrame) |
+return(resourceView);return null;},_showDatabase:function(database,tableName) |
{if(!database) |
return;var view;if(tableName){var tableViews=this._databaseTableViews.get(database);if(!tableViews){tableViews=({});this._databaseTableViews.put(database,tableViews);} |
view=tableViews[tableName];if(!view){view=new WebInspector.DatabaseTableView(database,tableName);tableViews[tableName]=view;}}else{view=this._databaseQueryViews.get(database);if(!view){view=new WebInspector.DatabaseQueryView(database);this._databaseQueryViews.put(database,view);view.addEventListener(WebInspector.DatabaseQueryView.Events.SchemaUpdated,this._updateDatabaseTables,this);}} |
@@ -344,9 +343,7 @@ |
if(this._applicationCacheViews[frameId]) |
this._applicationCacheViews[frameId].updateStatus(status);},_applicationCacheNetworkStateChanged:function(event) |
{var isNowOnline=event.data;for(var manifestURL in this._applicationCacheViews) |
-this._applicationCacheViews[manifestURL].updateNetworkState(isNowOnline);},_forAllResourceTreeElements:function(callback) |
-{var stop=false;for(var treeElement=this.resourcesListTreeElement;!stop&&treeElement;treeElement=treeElement.traverseNextTreeElement(false,this.resourcesListTreeElement,true)){if(treeElement instanceof WebInspector.FrameResourceTreeElement) |
-stop=callback(treeElement);}},_findTreeElementForResource:function(resource) |
+this._applicationCacheViews[manifestURL].updateNetworkState(isNowOnline);},_findTreeElementForResource:function(resource) |
{function isAncestor(ancestor,object) |
{return false;} |
function getParent(object) |
@@ -359,7 +356,12 @@ |
return;var element=listNode.treeElement;if(this._previousHoveredElement===element) |
return;if(this._previousHoveredElement){this._previousHoveredElement.hovered=false;delete this._previousHoveredElement;} |
if(element instanceof WebInspector.FrameTreeElement){this._previousHoveredElement=element;element.hovered=true;}},_onmouseout:function(event) |
-{if(this._previousHoveredElement){this._previousHoveredElement.hovered=false;delete this._previousHoveredElement;}},__proto__:WebInspector.Panel.prototype} |
+{if(this._previousHoveredElement){this._previousHoveredElement.hovered=false;delete this._previousHoveredElement;}},__proto__:WebInspector.PanelWithSidebarTree.prototype} |
+WebInspector.ResourcesPanel.ResourceRevealer=function() |
+{} |
+WebInspector.ResourcesPanel.ResourceRevealer.prototype={reveal:function(resource,lineNumber) |
+{if(resource instanceof WebInspector.Resource) |
+(WebInspector.inspectorView.showPanel("resources")).showResource(resource,lineNumber);}} |
WebInspector.BaseStorageTreeElement=function(storagePanel,representedObject,title,iconClasses,hasChildren,noIcon) |
{TreeElement.call(this,"",representedObject,hasChildren);this._storagePanel=storagePanel;this._titleText=title;this._iconClasses=iconClasses;this._noIcon=noIcon;} |
WebInspector.BaseStorageTreeElement.prototype={onattach:function() |
@@ -585,6 +587,6 @@ |
{if(this.fileSystemView&&this._storagePanel.visibleView===this.fileSystemView) |
this._storagePanel.closeVisibleView();},__proto__:WebInspector.BaseStorageTreeElement.prototype} |
WebInspector.StorageCategoryView=function() |
-{WebInspector.View.call(this);this.element.classList.add("storage-view");this._emptyView=new WebInspector.EmptyView("");this._emptyView.show(this.element);} |
+{WebInspector.VBox.call(this);this.element.classList.add("storage-view");this._emptyView=new WebInspector.EmptyView("");this._emptyView.show(this.element);} |
WebInspector.StorageCategoryView.prototype={setText:function(text) |
-{this._emptyView.text=text;},__proto__:WebInspector.View.prototype} |
+{this._emptyView.text=text;},__proto__:WebInspector.VBox.prototype} |