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

Unified Diff: chrome_linux/resources/inspector/SourcesPanel.js

Issue 85333005: Update reference builds to Chrome 32.0.1700.19 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/reference_builds/
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome_linux/resources/inspector/ScriptsPanel.js ('k') | chrome_linux/resources/inspector/TimelinePanel.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome_linux/resources/inspector/SourcesPanel.js
===================================================================
--- chrome_linux/resources/inspector/SourcesPanel.js (revision 237140)
+++ chrome_linux/resources/inspector/SourcesPanel.js (working copy)
@@ -4,7 +4,7 @@
WebInspector.JavaScriptBreakpointsSidebarPane.prototype={_emptyElementContextMenu:function(event)
{var contextMenu=new WebInspector.ContextMenu(event);var breakpointActive=WebInspector.debuggerModel.breakpointsActive();var breakpointActiveTitle=breakpointActive?WebInspector.UIString(WebInspector.useLowerCaseMenuTitles()?"Deactivate breakpoints":"Deactivate Breakpoints"):WebInspector.UIString(WebInspector.useLowerCaseMenuTitles()?"Activate breakpoints":"Activate Breakpoints");contextMenu.appendItem(breakpointActiveTitle,WebInspector.debuggerModel.setBreakpointsActive.bind(WebInspector.debuggerModel,!breakpointActive));contextMenu.show();},_breakpointAdded:function(event)
{this._breakpointRemoved(event);var breakpoint=(event.data.breakpoint);var uiLocation=(event.data.uiLocation);this._addBreakpoint(breakpoint,uiLocation);},_addBreakpoint:function(breakpoint,uiLocation)
-{var element=document.createElement("li");element.addStyleClass("cursor-pointer");element.addEventListener("contextmenu",this._breakpointContextMenu.bind(this,breakpoint),true);element.addEventListener("click",this._breakpointClicked.bind(this,uiLocation),false);var checkbox=document.createElement("input");checkbox.className="checkbox-elem";checkbox.type="checkbox";checkbox.checked=breakpoint.enabled();checkbox.addEventListener("click",this._breakpointCheckboxClicked.bind(this,breakpoint),false);element.appendChild(checkbox);var labelElement=document.createTextNode(uiLocation.linkText());element.appendChild(labelElement);var snippetElement=document.createElement("div");snippetElement.className="source-text monospace";element.appendChild(snippetElement);function didRequestContent(content,contentEncoded,mimeType)
+{var element=document.createElement("li");element.addStyleClass("cursor-pointer");element.addEventListener("contextmenu",this._breakpointContextMenu.bind(this,breakpoint),true);element.addEventListener("click",this._breakpointClicked.bind(this,uiLocation),false);var checkbox=document.createElement("input");checkbox.className="checkbox-elem";checkbox.type="checkbox";checkbox.checked=breakpoint.enabled();checkbox.addEventListener("click",this._breakpointCheckboxClicked.bind(this,breakpoint),false);element.appendChild(checkbox);var labelElement=document.createTextNode(uiLocation.linkText());element.appendChild(labelElement);var snippetElement=document.createElement("div");snippetElement.className="source-text monospace";element.appendChild(snippetElement);function didRequestContent(content)
{var lineEndings=content.lineEndings();if(uiLocation.lineNumber<lineEndings.length)
snippetElement.textContent=content.substring(lineEndings[uiLocation.lineNumber-1],lineEndings[uiLocation.lineNumber]);}
uiLocation.uiSourceCode.requestContent(didRequestContent.bind(this));element._data=uiLocation;var currentElement=this.listElement.firstChild;while(currentElement){if(currentElement._data&&this._compareBreakpoints(currentElement._data,element._data)>0)
@@ -240,7 +240,7 @@
WebInspector.JavaScriptOutlineDialog.show=function(view,contentProvider)
{if(WebInspector.Dialog.currentInstance())
return null;var filteredItemSelectionDialog=new WebInspector.FilteredItemSelectionDialog(new WebInspector.JavaScriptOutlineDialog(view,contentProvider));WebInspector.Dialog.show(view.element,filteredItemSelectionDialog);}
-WebInspector.JavaScriptOutlineDialog.prototype={_contentAvailable:function(content,contentEncoded,mimeType)
+WebInspector.JavaScriptOutlineDialog.prototype={_contentAvailable:function(content)
{this._outlineWorker=new Worker("ScriptFormatterWorker.js");this._outlineWorker.onmessage=this._didBuildOutlineChunk.bind(this);const method="outline";this._outlineWorker.postMessage({method:method,params:{content:content}});},_didBuildOutlineChunk:function(event)
{var data=event.data;var chunk=data["chunk"];for(var i=0;i<chunk.length;++i)
this._functionItems.push(chunk[i]);if(data.total===data.index)
@@ -295,8 +295,9 @@
WebInspector.SelectUISourceCodeForProjectTypeDialog.show=function(name,type,callback,relativeToElement)
{if(WebInspector.Dialog.currentInstance())
return;var filteredItemSelectionDialog=new WebInspector.FilteredItemSelectionDialog(new WebInspector.SelectUISourceCodeForProjectTypeDialog(type,callback));filteredItemSelectionDialog.setQuery(name);filteredItemSelectionDialog.renderAsTwoRows();WebInspector.Dialog.show(relativeToElement,filteredItemSelectionDialog);};WebInspector.UISourceCodeFrame=function(uiSourceCode)
-{this._uiSourceCode=uiSourceCode;WebInspector.SourceFrame.call(this,this._uiSourceCode);this.textEditor.setCompletionDictionary(new WebInspector.SampleCompletionDictionary());this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.FormattedChanged,this._onFormattedChanged,this);this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.WorkingCopyChanged,this._onWorkingCopyChanged,this);this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.WorkingCopyCommitted,this._onWorkingCopyCommitted,this);this._updateStyle();}
-WebInspector.UISourceCodeFrame.prototype={wasShown:function()
+{this._uiSourceCode=uiSourceCode;WebInspector.SourceFrame.call(this,this._uiSourceCode);WebInspector.settings.textEditorAutocompletion.addChangeListener(this._enableAutocompletionIfNeeded,this);this._enableAutocompletionIfNeeded();this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.FormattedChanged,this._onFormattedChanged,this);this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.WorkingCopyChanged,this._onWorkingCopyChanged,this);this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.WorkingCopyCommitted,this._onWorkingCopyCommitted,this);this._updateStyle();}
+WebInspector.UISourceCodeFrame.prototype={_enableAutocompletionIfNeeded:function()
+{this.textEditor.setCompletionDictionary(WebInspector.settings.textEditorAutocompletion.get()?new WebInspector.SampleCompletionDictionary():null);},wasShown:function()
{WebInspector.SourceFrame.prototype.wasShown.call(this);this._boundWindowFocused=this._windowFocused.bind(this);window.addEventListener("focus",this._boundWindowFocused,false);this._checkContentUpdated();},willHide:function()
{WebInspector.SourceFrame.prototype.willHide.call(this);window.removeEventListener("focus",this._boundWindowFocused,false);delete this._boundWindowFocused;this._uiSourceCode.removeWorkingCopyGetter();},canEditSource:function()
{return this._uiSourceCode.isEditable();},_windowFocused:function(event)
@@ -310,20 +311,25 @@
this._uiSourceCode.resetWorkingCopy();else
this._uiSourceCode.setWorkingCopyGetter(this._textEditor.text.bind(this._textEditor));delete this._muteSourceCodeEvents;},_didEditContent:function(error)
{if(error){WebInspector.log(error,WebInspector.ConsoleMessage.MessageLevel.Error,true);return;}},_onFormattedChanged:function(event)
-{var content=(event.data.content);this._textEditor.setReadOnly(this._uiSourceCode.formatted());this._innerSetContent(content);},_onWorkingCopyChanged:function(event)
+{var content=(event.data.content);this._textEditor.setReadOnly(this._uiSourceCode.formatted());var selection=this._textEditor.selection();this._innerSetContent(content);var start=null;var end=null;if(this._uiSourceCode.formatted()){start=event.data.newFormatter.originalToFormatted(selection.startLine,selection.startColumn);end=event.data.newFormatter.originalToFormatted(selection.endLine,selection.endColumn);}else{start=event.data.oldFormatter.formattedToOriginal(selection.startLine,selection.startColumn);end=event.data.oldFormatter.formattedToOriginal(selection.endLine,selection.endColumn);}
+this.textEditor.setSelection(new WebInspector.TextRange(start[0],start[1],end[0],end[1]));this.textEditor.revealLine(start[0]);},_onWorkingCopyChanged:function(event)
{if(this._muteSourceCodeEvents)
return;this._innerSetContent(this._uiSourceCode.workingCopy());this.onUISourceCodeContentChanged();},_onWorkingCopyCommitted:function(event)
{if(!this._muteSourceCodeEvents){this._innerSetContent(this._uiSourceCode.workingCopy());this.onUISourceCodeContentChanged();}
this._textEditor.markClean();this._updateStyle();},_updateStyle:function()
{this.element.enableStyleClass("source-frame-unsaved-committed-changes",this._uiSourceCode.hasUnsavedCommittedChanges());},onUISourceCodeContentChanged:function()
{},_innerSetContent:function(content)
-{this._isSettingContent=true;this.setContent(content,false,this._uiSourceCode.mimeType());delete this._isSettingContent;},populateTextAreaContextMenu:function(contextMenu,lineNumber)
+{this._isSettingContent=true;this.setContent(content);delete this._isSettingContent;},populateTextAreaContextMenu:function(contextMenu,lineNumber)
{WebInspector.SourceFrame.prototype.populateTextAreaContextMenu.call(this,contextMenu,lineNumber);contextMenu.appendApplicableItems(this._uiSourceCode);contextMenu.appendSeparator();},dispose:function()
{this.detach();},__proto__:WebInspector.SourceFrame.prototype};WebInspector.JavaScriptSourceFrame=function(scriptsPanel,uiSourceCode)
{this._scriptsPanel=scriptsPanel;this._breakpointManager=WebInspector.breakpointManager;this._uiSourceCode=uiSourceCode;WebInspector.UISourceCodeFrame.call(this,uiSourceCode);if(uiSourceCode.project().type()===WebInspector.projectTypes.Debugger)
this.element.addStyleClass("source-frame-debugger-script");this._popoverHelper=new WebInspector.ObjectPopoverHelper(this.textEditor.element,this._getPopoverAnchor.bind(this),this._resolveObjectForPopover.bind(this),this._onHidePopover.bind(this),true);this.textEditor.element.addEventListener("keydown",this._onKeyDown.bind(this),true);this.textEditor.addEventListener(WebInspector.TextEditor.Events.GutterClick,this._handleGutterClick.bind(this),this);this.textEditor.element.addEventListener("mousedown",this._onMouseDownAndClick.bind(this,true),true);this.textEditor.element.addEventListener("click",this._onMouseDownAndClick.bind(this,false),true);this._breakpointManager.addEventListener(WebInspector.BreakpointManager.Events.BreakpointAdded,this._breakpointAdded,this);this._breakpointManager.addEventListener(WebInspector.BreakpointManager.Events.BreakpointRemoved,this._breakpointRemoved,this);this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.ConsoleMessageAdded,this._consoleMessageAdded,this);this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.ConsoleMessageRemoved,this._consoleMessageRemoved,this);this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.ConsoleMessagesCleared,this._consoleMessagesCleared,this);this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.SourceMappingChanged,this._onSourceMappingChanged,this);this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.WorkingCopyChanged,this._workingCopyChanged,this);this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.WorkingCopyCommitted,this._workingCopyCommitted,this);this._registerShortcuts();this._updateScriptFile();}
WebInspector.JavaScriptSourceFrame.prototype={_registerShortcuts:function()
-{var modifiers=WebInspector.KeyboardShortcut.Modifiers;this.addShortcut(WebInspector.KeyboardShortcut.makeKey("e",modifiers.Shift|modifiers.Ctrl),this._evaluateSelectionInConsole.bind(this));},_evaluateSelectionInConsole:function(event)
+{var shortcutKeys=WebInspector.SourcesPanelDescriptor.ShortcutKeys;for(var i=0;i<shortcutKeys.EvaluateSelectionInConsole.length;++i){var keyDescriptor=shortcutKeys.EvaluateSelectionInConsole[i];this.addShortcut(keyDescriptor.key,this._evaluateSelectionInConsole.bind(this));}
+for(var i=0;i<shortcutKeys.AddSelectionToWatch.length;++i){var keyDescriptor=shortcutKeys.AddSelectionToWatch[i];this.addShortcut(keyDescriptor.key,this._addCurrentSelectionToWatch.bind(this));}},_addCurrentSelectionToWatch:function()
+{var textSelection=this.textEditor.selection();if(textSelection&&!textSelection.isEmpty())
+this._innerAddToWatch(this.textEditor.copyRange(textSelection));},_innerAddToWatch:function(expression)
+{this._scriptsPanel.addToWatch(expression);},_evaluateSelectionInConsole:function(event)
{var selection=this.textEditor.selection();if(!selection||selection.isEmpty())
return false;WebInspector.evaluateInConsole(this.textEditor.copyRange(selection));return true;},wasShown:function()
{WebInspector.UISourceCodeFrame.prototype.wasShown.call(this);},willHide:function()
@@ -332,7 +338,7 @@
{contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles()?"Continue to here":"Continue to Here"),this._continueToLine.bind(this,lineNumber));var breakpoint=this._breakpointManager.findBreakpoint(this._uiSourceCode,lineNumber);if(!breakpoint){contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles()?"Add breakpoint":"Add Breakpoint"),this._setBreakpoint.bind(this,lineNumber,"",true));contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles()?"Add conditional breakpoint…":"Add Conditional Breakpoint…"),this._editBreakpointCondition.bind(this,lineNumber));}else{contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles()?"Remove breakpoint":"Remove Breakpoint"),breakpoint.remove.bind(breakpoint));contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles()?"Edit breakpoint…":"Edit Breakpoint…"),this._editBreakpointCondition.bind(this,lineNumber,breakpoint));if(breakpoint.enabled())
contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles()?"Disable breakpoint":"Disable Breakpoint"),breakpoint.setEnabled.bind(breakpoint,false));else
contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles()?"Enable breakpoint":"Enable Breakpoint"),breakpoint.setEnabled.bind(breakpoint,true));}},populateTextAreaContextMenu:function(contextMenu,lineNumber)
-{var textSelection=this.textEditor.selection();if(textSelection&&!textSelection.isEmpty()){var selection=this.textEditor.copyRange(textSelection);var addToWatchLabel=WebInspector.UIString(WebInspector.useLowerCaseMenuTitles()?"Add to watch":"Add to Watch");contextMenu.appendItem(addToWatchLabel,this._scriptsPanel.addToWatch.bind(this._scriptsPanel,selection));var evaluateLabel=WebInspector.UIString(WebInspector.useLowerCaseMenuTitles()?"Evaluate in console":"Evaluate in Console");contextMenu.appendItem(evaluateLabel,WebInspector.evaluateInConsole.bind(WebInspector,selection));contextMenu.appendSeparator();}else if(!this._uiSourceCode.isEditable()&&this._uiSourceCode.contentType()===WebInspector.resourceTypes.Script){function liveEdit(event)
+{var textSelection=this.textEditor.selection();if(textSelection&&!textSelection.isEmpty()){var selection=this.textEditor.copyRange(textSelection);var addToWatchLabel=WebInspector.UIString(WebInspector.useLowerCaseMenuTitles()?"Add to watch":"Add to Watch");contextMenu.appendItem(addToWatchLabel,this._innerAddToWatch.bind(this,selection));var evaluateLabel=WebInspector.UIString(WebInspector.useLowerCaseMenuTitles()?"Evaluate in console":"Evaluate in Console");contextMenu.appendItem(evaluateLabel,WebInspector.evaluateInConsole.bind(WebInspector,selection));contextMenu.appendSeparator();}else if(!this._uiSourceCode.isEditable()&&this._uiSourceCode.contentType()===WebInspector.resourceTypes.Script){function liveEdit(event)
{var liveEditUISourceCode=WebInspector.liveEditSupport.uiSourceCodeForLiveEdit(this._uiSourceCode);this._scriptsPanel.showUISourceCode(liveEditUISourceCode,lineNumber)}
var liveEditLabel=WebInspector.UIString(WebInspector.useLowerCaseMenuTitles()?"Live edit":"Live Edit");contextMenu.appendItem(liveEditLabel,liveEdit.bind(this));contextMenu.appendSeparator();}
WebInspector.UISourceCodeFrame.prototype.populateTextAreaContextMenu.call(this,contextMenu,lineNumber);},_workingCopyChanged:function(event)
@@ -468,8 +474,23 @@
return new WebInspector.JavaScriptSourceFrame.StepIntoMarkup(stepIntoRawLocations,uiRanges,firstToExecuteIndex,sourceFrame);};WebInspector.JavaScriptSourceFrame.StepIntoMarkup._Comparator=function(locationA,locationB)
{if(locationA.lineNumber===locationB.lineNumber)
return locationA.columnNumber-locationB.columnNumber;else
-return locationA.lineNumber-locationB.lineNumber;};;WebInspector.NavigatorOverlayController=function(parentSidebarView,navigatorView,editorView)
-{this._parentSidebarView=parentSidebarView;this._navigatorView=navigatorView;this._editorView=editorView;this._navigatorSidebarResizeWidgetElement=this._navigatorView.element.createChild("div","resizer-widget");this._parentSidebarView.installResizer(this._navigatorSidebarResizeWidgetElement);this._navigatorShowHideButton=new WebInspector.StatusBarButton(WebInspector.UIString("Hide navigator"),"left-sidebar-show-hide-button scripts-navigator-show-hide-button",3);this._navigatorShowHideButton.state="left";this._navigatorShowHideButton.addEventListener("click",this._toggleNavigator,this);this._editorView.element.appendChild(this._navigatorShowHideButton.element);WebInspector.settings.navigatorHidden=WebInspector.settings.createSetting("navigatorHidden",true);if(WebInspector.settings.navigatorHidden.get())
+return locationA.lineNumber-locationB.lineNumber;};;WebInspector.CSSSourceFrame=function(uiSourceCode)
+{WebInspector.UISourceCodeFrame.call(this,uiSourceCode);this._registerShortcuts();}
+WebInspector.CSSSourceFrame.prototype={_registerShortcuts:function()
+{var shortcutKeys=WebInspector.SourcesPanelDescriptor.ShortcutKeys;for(var i=0;i<shortcutKeys.IncreaseCSSUnitByOne.length;++i)
+this.addShortcut(shortcutKeys.IncreaseCSSUnitByOne[i].key,this._handleUnitModification.bind(this,1));for(var i=0;i<shortcutKeys.DecreaseCSSUnitByOne.length;++i)
+this.addShortcut(shortcutKeys.DecreaseCSSUnitByOne[i].key,this._handleUnitModification.bind(this,-1));for(var i=0;i<shortcutKeys.IncreaseCSSUnitByTen.length;++i)
+this.addShortcut(shortcutKeys.IncreaseCSSUnitByTen[i].key,this._handleUnitModification.bind(this,10));for(var i=0;i<shortcutKeys.DecreaseCSSUnitByTen.length;++i)
+this.addShortcut(shortcutKeys.DecreaseCSSUnitByTen[i].key,this._handleUnitModification.bind(this,-10));},_modifyUnit:function(unit,change)
+{var unitValue=parseInt(unit,10);if(isNaN(unitValue))
+return null;var tail=unit.substring((unitValue).toString().length);return String.sprintf("%d%s",unitValue+change,tail);},_handleUnitModification:function(change)
+{var selection=this.textEditor.selection().normalize();var token=this.textEditor.tokenAtTextPosition(selection.startLine,selection.startColumn);if(!token){if(selection.startColumn>0)
+token=this.textEditor.tokenAtTextPosition(selection.startLine,selection.startColumn-1);if(!token)
+return false;}
+if(token.type!=="css-number")
+return false;var cssUnitRange=new WebInspector.TextRange(selection.startLine,token.startColumn,selection.startLine,token.endColumn+1);var cssUnitText=this.textEditor.copyRange(cssUnitRange);var newUnitText=this._modifyUnit(cssUnitText,change);if(!newUnitText)
+return false;this.textEditor.editRange(cssUnitRange,newUnitText);selection.startColumn=token.startColumn;selection.endColumn=selection.startColumn+newUnitText.length;this.textEditor.setSelection(selection);return true;},__proto__:WebInspector.UISourceCodeFrame.prototype};WebInspector.NavigatorOverlayController=function(parentSidebarView,navigatorView,editorView)
+{this._parentSidebarView=parentSidebarView;this._navigatorView=navigatorView;this._editorView=editorView;this._navigatorSidebarResizeWidgetElement=this._navigatorView.element.createChild("div","resizer-widget");this._parentSidebarView.installResizer(this._navigatorSidebarResizeWidgetElement);this._navigatorShowHideButton=new WebInspector.StatusBarButton(WebInspector.UIString("Hide navigator"),"left-sidebar-show-hide-button scripts-navigator-show-hide-button",3);this._navigatorShowHideButton.state="left";this._navigatorShowHideButton.addEventListener("click",this._toggleNavigator,this);parentSidebarView.mainElement.appendChild(this._navigatorShowHideButton.element);WebInspector.settings.navigatorHidden=WebInspector.settings.createSetting("navigatorHidden",true);if(WebInspector.settings.navigatorHidden.get())
this._toggleNavigator();}
WebInspector.NavigatorOverlayController.prototype={wasShown:function()
{window.setTimeout(this._maybeShowNavigatorOverlay.bind(this),0);},_maybeShowNavigatorOverlay:function()
@@ -514,11 +535,13 @@
{var node=this._uiSourceCodeNodes.get(uiSourceCode);if(!node)
return null;if(this._scriptsTree.selectedTreeElement)
this._scriptsTree.selectedTreeElement.deselect();this._lastSelectedUISourceCode=uiSourceCode;node.reveal(select);},_sourceSelected:function(uiSourceCode,focusSource)
-{this._lastSelectedUISourceCode=uiSourceCode;var data={uiSourceCode:uiSourceCode,focusSource:focusSource};this.dispatchEventToListeners(WebInspector.NavigatorView.Events.ItemSelected,data);},removeUISourceCode:function(uiSourceCode)
+{this._lastSelectedUISourceCode=uiSourceCode;var data={uiSourceCode:uiSourceCode,focusSource:focusSource};this.dispatchEventToListeners(WebInspector.NavigatorView.Events.ItemSelected,data);},sourceDeleted:function(uiSourceCode)
+{},removeUISourceCode:function(uiSourceCode)
{var node=this._uiSourceCodeNodes.get(uiSourceCode);if(!node)
return;var projectNode=this._projectNode(uiSourceCode.project());var subfolderNodes=this._subfolderNodes.get(projectNode);var parentNode=node.parent;this._uiSourceCodeNodes.remove(uiSourceCode);parentNode.removeChild(node);node=parentNode;while(node){parentNode=node.parent;if(!parentNode||!node.isEmpty())
break;if(subfolderNodes)
-subfolderNodes.remove(node._folderPath);parentNode.removeChild(node);node=parentNode;}},requestRename:function(uiSourceCode)
+subfolderNodes.remove(node._folderPath);parentNode.removeChild(node);node=parentNode;}},updateIcon:function(uiSourceCode)
+{var node=this._uiSourceCodeNodes.get(uiSourceCode);node.updateIcon();},requestRename:function(uiSourceCode)
{this.dispatchEventToListeners(WebInspector.SourcesNavigator.Events.ItemRenamingRequested,uiSourceCode);},rename:function(uiSourceCode,callback)
{var node=this._uiSourceCodeNodes.get(uiSourceCode);if(!node)
return null;node.rename(callback);},reset:function()
@@ -527,16 +550,15 @@
{var contextMenu=new WebInspector.ContextMenu(event);this._appendAddFolderItem(contextMenu);contextMenu.show();},_appendAddFolderItem:function(contextMenu)
{function addFolder()
{WebInspector.isolatedFileSystemManager.addFileSystem();}
-var addFolderLabel=WebInspector.UIString(WebInspector.useLowerCaseMenuTitles()?"Add folder to workspace":"Add Folder to Workspace");contextMenu.appendItem(addFolderLabel,addFolder);},handleFileContextMenu:function(event,uiSourceCode)
-{var contextMenu=new WebInspector.ContextMenu(event);contextMenu.appendApplicableItems(uiSourceCode);contextMenu.appendSeparator();this._appendAddFolderItem(contextMenu);contextMenu.show();},handleFolderContextMenu:function(event,node)
+var addFolderLabel=WebInspector.UIString(WebInspector.useLowerCaseMenuTitles()?"Add folder to workspace":"Add Folder to Workspace");contextMenu.appendItem(addFolderLabel,addFolder);},_handleContextMenuRefresh:function(project,path)
+{project.refresh(path);},_handleContextMenuCreate:function(project,path,uiSourceCode)
+{var data={};data.project=project;data.path=path;data.uiSourceCode=uiSourceCode;this.dispatchEventToListeners(WebInspector.NavigatorView.Events.ItemCreationRequested,data);},_handleContextMenuExclude:function(project,path)
+{var shouldExclude=window.confirm(WebInspector.UIString("Are you sure you want to exclude this folder?"));if(shouldExclude){WebInspector.startBatchUpdate();project.excludeFolder(path);WebInspector.endBatchUpdate();}},_handleContextMenuDelete:function(uiSourceCode)
+{var shouldDelete=window.confirm(WebInspector.UIString("Are you sure you want to delete this file?"));if(shouldDelete)
+uiSourceCode.project().deleteFile(uiSourceCode.path());},handleFileContextMenu:function(event,uiSourceCode)
+{var contextMenu=new WebInspector.ContextMenu(event);contextMenu.appendApplicableItems(uiSourceCode);contextMenu.appendSeparator();var project=uiSourceCode.project();var path=uiSourceCode.parentPath();contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles()?"Refresh parent":"Refresh Parent"),this._handleContextMenuRefresh.bind(this,project,path));contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles()?"Duplicate file":"Duplicate File"),this._handleContextMenuCreate.bind(this,project,path,uiSourceCode));contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles()?"Exclude parent folder":"Exclude Parent Folder"),this._handleContextMenuExclude.bind(this,project,path));contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles()?"Delete file":"Delete File"),this._handleContextMenuDelete.bind(this,uiSourceCode));contextMenu.appendSeparator();this._appendAddFolderItem(contextMenu);contextMenu.show();},handleFolderContextMenu:function(event,node)
{var contextMenu=new WebInspector.ContextMenu(event);var path="/";var projectNode=node;while(projectNode.parent!==this._rootNode){path="/"+projectNode.id+path;projectNode=projectNode.parent;}
-var project=projectNode._project;if(project.type()===WebInspector.projectTypes.FileSystem){function refresh()
-{project.refresh(path);}
-contextMenu.appendItem(WebInspector.UIString("Refresh"),refresh.bind(this));function create()
-{var data={};data.project=project;data.path=path;this.dispatchEventToListeners(WebInspector.NavigatorView.Events.ItemCreationRequested,data);}
-contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles()?"New file":"New File"),create.bind(this));function exclude()
-{var shouldExclude=window.confirm(WebInspector.UIString("Are you sure you want to exclude this folder?"));if(shouldExclude){WebInspector.startBatchUpdate();project.excludeFolder(path);WebInspector.endBatchUpdate();}}
-contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles()?"Exclude folder":"Exclude Folder"),exclude.bind(this));}
+var project=projectNode._project;if(project.type()===WebInspector.projectTypes.FileSystem){contextMenu.appendItem(WebInspector.UIString("Refresh"),this._handleContextMenuRefresh.bind(this,project,path));contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles()?"New file":"New File"),this._handleContextMenuCreate.bind(this,project,path));contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles()?"Exclude folder":"Exclude Folder"),this._handleContextMenuExclude.bind(this,project,path));}
contextMenu.appendSeparator();this._appendAddFolderItem(contextMenu);if(project.type()===WebInspector.projectTypes.FileSystem&&node===projectNode){function removeFolder()
{var shouldRemove=window.confirm(WebInspector.UIString("Are you sure you want to remove this folder?"));if(shouldRemove)
project.remove();}
@@ -569,7 +591,10 @@
{this.listItemElement.removeChildren();if(this._iconClasses){for(var i=0;i<this._iconClasses.length;++i)
this.listItemElement.addStyleClass(this._iconClasses[i]);}
var selectionElement=document.createElement("div");selectionElement.className="selection";this.listItemElement.appendChild(selectionElement);if(!this._noIcon){this.imageElement=document.createElement("img");this.imageElement.className="icon";this.listItemElement.appendChild(this.imageElement);}
-this.titleElement=document.createElement("div");this.titleElement.className="base-navigator-tree-element-title";this._titleTextNode=document.createTextNode("");this._titleTextNode.textContent=this._titleText;this.titleElement.appendChild(this._titleTextNode);this.listItemElement.appendChild(this.titleElement);},onreveal:function()
+this.titleElement=document.createElement("div");this.titleElement.className="base-navigator-tree-element-title";this._titleTextNode=document.createTextNode("");this._titleTextNode.textContent=this._titleText;this.titleElement.appendChild(this._titleTextNode);this.listItemElement.appendChild(this.titleElement);},updateIconClasses:function(iconClasses)
+{for(var i=0;i<this._iconClasses.length;++i)
+this.listItemElement.removeStyleClass(this._iconClasses[i]);this._iconClasses=iconClasses;for(var i=0;i<this._iconClasses.length;++i)
+this.listItemElement.addStyleClass(this._iconClasses[i]);},onreveal:function()
{if(this.listItemElement)
this.listItemElement.scrollIntoViewIfNeeded(true);},get titleText()
{return this._titleText;},set titleText(titleText)
@@ -587,12 +612,14 @@
{if(!this._node)
return;this.select();this._navigatorView.handleFolderContextMenu(event,this._node);},__proto__:WebInspector.BaseNavigatorTreeElement.prototype}
WebInspector.NavigatorSourceTreeElement=function(navigatorView,uiSourceCode,title)
-{WebInspector.BaseNavigatorTreeElement.call(this,WebInspector.NavigatorTreeOutline.Types.UISourceCode,title,["navigator-"+uiSourceCode.contentType().name()+"-tree-item"],false);this._navigatorView=navigatorView;this._uiSourceCode=uiSourceCode;this.tooltip=uiSourceCode.originURL();}
+{this._navigatorView=navigatorView;this._uiSourceCode=uiSourceCode;WebInspector.BaseNavigatorTreeElement.call(this,WebInspector.NavigatorTreeOutline.Types.UISourceCode,title,this._calculateIconClasses(),false);this.tooltip=uiSourceCode.originURL();}
WebInspector.NavigatorSourceTreeElement.prototype={get uiSourceCode()
-{return this._uiSourceCode;},onattach:function()
+{return this._uiSourceCode;},_calculateIconClasses:function()
+{return["navigator-"+this._uiSourceCode.contentType().name()+"-tree-item"];},updateIcon:function()
+{this.updateIconClasses(this._calculateIconClasses());},onattach:function()
{WebInspector.BaseNavigatorTreeElement.prototype.onattach.call(this);this.listItemElement.draggable=true;this.listItemElement.addEventListener("click",this._onclick.bind(this),false);this.listItemElement.addEventListener("contextmenu",this._handleContextMenuEvent.bind(this),false);this.listItemElement.addEventListener("mousedown",this._onmousedown.bind(this),false);this.listItemElement.addEventListener("dragstart",this._ondragstart.bind(this),false);},_onmousedown:function(event)
{if(event.which===1)
-this._uiSourceCode.requestContent(callback.bind(this));function callback(content,contentEncoded,mimeType)
+this._uiSourceCode.requestContent(callback.bind(this));function callback(content)
{this._warmedUpContent=content;}},_shouldRenameOnMouseDown:function()
{if(!this._uiSourceCode.canRename())
return false;var isSelected=this===this.treeOutline.selectedTreeElement;var isFocused=this.treeOutline.childrenListElement.isSelfOrAncestor(document.activeElement);return isSelected&&isFocused&&!WebInspector.isBeingEdited(this.treeOutline.element);},selectOnMouseDown:function(event)
@@ -604,7 +631,8 @@
{this._navigatorView._sourceSelected(this.uiSourceCode,true);return true;},_onclick:function(event)
{this._navigatorView._sourceSelected(this.uiSourceCode,false);},ondblclick:function(event)
{var middleClick=event.button===1;this._navigatorView._sourceSelected(this.uiSourceCode,!middleClick);},onenter:function()
-{this._navigatorView._sourceSelected(this.uiSourceCode,true);return true;},_handleContextMenuEvent:function(event)
+{this._navigatorView._sourceSelected(this.uiSourceCode,true);return true;},ondelete:function()
+{this._navigatorView.sourceDeleted(this.uiSourceCode);return true;},_handleContextMenuEvent:function(event)
{this.select();this._navigatorView.handleFileContextMenu(event,this._uiSourceCode);},__proto__:WebInspector.BaseNavigatorTreeElement.prototype}
WebInspector.NavigatorTreeNode=function(id)
{this.id=id;this._children=new StringMap();}
@@ -635,8 +663,10 @@
WebInspector.NavigatorUISourceCodeTreeNode=function(navigatorView,uiSourceCode)
{WebInspector.NavigatorTreeNode.call(this,uiSourceCode.name());this._navigatorView=navigatorView;this._uiSourceCode=uiSourceCode;this._treeElement=null;}
WebInspector.NavigatorUISourceCodeTreeNode.prototype={uiSourceCode:function()
-{return this._uiSourceCode;},treeElement:function()
+{return this._uiSourceCode;},updateIcon:function()
{if(this._treeElement)
+this._treeElement.updateIcon();},treeElement:function()
+{if(this._treeElement)
return this._treeElement;this._treeElement=new WebInspector.NavigatorSourceTreeElement(this._navigatorView,this._uiSourceCode,"");this.updateTitle();this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.TitleChanged,this._titleChanged,this);this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.WorkingCopyChanged,this._workingCopyChanged,this);this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.WorkingCopyCommitted,this._workingCopyCommitted,this);this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.FormattedChanged,this._formattedChanged,this);return this._treeElement;},updateTitle:function(ignoreIsDirty)
{if(!this._treeElement)
return;var titleText=this._uiSourceCode.displayName();if(!ignoreIsDirty&&(this._uiSourceCode.isDirty()||this._uiSourceCode.hasUnsavedCommittedChanges()))
@@ -692,10 +722,10 @@
{WebInspector.View.call(this);this.registerRequiredCSS("revisionHistory.css");this.element.addStyleClass("revision-history-drawer");this.element.addStyleClass("fill");this.element.addStyleClass("outline-disclosure");this._uiSourceCodeItems=new Map();var olElement=this.element.createChild("ol");this._treeOutline=new TreeOutline(olElement);function populateRevisions(uiSourceCode)
{if(uiSourceCode.history.length)
this._createUISourceCodeItem(uiSourceCode);}
-WebInspector.workspace.uiSourceCodes().forEach(populateRevisions.bind(this));WebInspector.workspace.addEventListener(WebInspector.Workspace.Events.UISourceCodeContentCommitted,this._revisionAdded,this);WebInspector.workspace.addEventListener(WebInspector.Workspace.Events.UISourceCodeRemoved,this._uiSourceCodeRemoved,this);WebInspector.workspace.addEventListener(WebInspector.Workspace.Events.ProjectWillReset,this._projectWillReset,this);this._statusElement=document.createElement("span");this._statusElement.textContent=WebInspector.UIString("Local modifications");}
+WebInspector.workspace.uiSourceCodes().forEach(populateRevisions.bind(this));WebInspector.workspace.addEventListener(WebInspector.Workspace.Events.UISourceCodeContentCommitted,this._revisionAdded,this);WebInspector.workspace.addEventListener(WebInspector.Workspace.Events.UISourceCodeRemoved,this._uiSourceCodeRemoved,this);WebInspector.workspace.addEventListener(WebInspector.Workspace.Events.ProjectWillReset,this._projectWillReset,this);}
WebInspector.RevisionHistoryView.showHistory=function(uiSourceCode)
{if(!WebInspector.RevisionHistoryView._view)
-WebInspector.RevisionHistoryView._view=new WebInspector.RevisionHistoryView();var view=WebInspector.RevisionHistoryView._view;WebInspector.showViewInDrawer(view._statusElement,view);view._revealUISourceCode(uiSourceCode);}
+WebInspector.RevisionHistoryView._view=new WebInspector.RevisionHistoryView();var view=WebInspector.RevisionHistoryView._view;WebInspector.inspectorView.showCloseableViewInDrawer("history",WebInspector.UIString("History"),view);view._revealUISourceCode(uiSourceCode);}
WebInspector.RevisionHistoryView.prototype={_createUISourceCodeItem:function(uiSourceCode)
{var uiSourceCodeItem=new TreeElement(uiSourceCode.displayName(),null,true);uiSourceCodeItem.selectable=false;for(var i=0;i<this._treeOutline.children.length;++i){if(this._treeOutline.children[i].title.localeCompare(uiSourceCode.displayName())>0){this._treeOutline.insertChild(uiSourceCodeItem,i);break;}}
if(i===this._treeOutline.children.length)
@@ -767,7 +797,8 @@
{this._navigatorViewForUISourceCode(uiSourceCode).removeUISourceCode(uiSourceCode);},revealUISourceCode:function(uiSourceCode,select)
{this._navigatorViewForUISourceCode(uiSourceCode).revealUISourceCode(uiSourceCode,select);if(uiSourceCode.isContentScript)
this._tabbedPane.selectTab(WebInspector.SourcesNavigator.ContentScriptsTab);else if(uiSourceCode.project().type()!==WebInspector.projectTypes.Snippets)
-this._tabbedPane.selectTab(WebInspector.SourcesNavigator.SourcesTab);},rename:function(uiSourceCode,callback)
+this._tabbedPane.selectTab(WebInspector.SourcesNavigator.SourcesTab);},updateIcon:function(uiSourceCode)
+{this._navigatorViewForUISourceCode(uiSourceCode).updateIcon(uiSourceCode);},rename:function(uiSourceCode,callback)
{this._navigatorViewForUISourceCode(uiSourceCode).rename(uiSourceCode,callback);},_sourceSelected:function(event)
{this.dispatchEventToListeners(WebInspector.SourcesNavigator.Events.SourceSelected,event.data);},_itemSearchStarted:function(event)
{this.dispatchEventToListeners(WebInspector.SourcesNavigator.Events.ItemSearchStarted,event.data);},_itemRenamingRequested:function(event)
@@ -781,8 +812,9 @@
{if(uiSourceCode.project().type()!==WebInspector.projectTypes.Snippets)
return;WebInspector.scriptSnippetModel.evaluateScriptSnippet(uiSourceCode);},_handleRemoveSnippet:function(uiSourceCode)
{if(uiSourceCode.project().type()!==WebInspector.projectTypes.Snippets)
-return;uiSourceCode.project().deleteFile(uiSourceCode);},_handleCreateSnippet:function()
-{var data={};data.project=WebInspector.scriptSnippetModel.project();data.path="";this.dispatchEventToListeners(WebInspector.NavigatorView.Events.ItemCreationRequested,data);},__proto__:WebInspector.NavigatorView.prototype};WebInspector.SourcesSearchScope=function(workspace)
+return;uiSourceCode.project().deleteFile(uiSourceCode.path());},_handleCreateSnippet:function()
+{var data={};data.project=WebInspector.scriptSnippetModel.project();data.path="";this.dispatchEventToListeners(WebInspector.NavigatorView.Events.ItemCreationRequested,data);},sourceDeleted:function(uiSourceCode)
+{this._handleRemoveSnippet(uiSourceCode);},__proto__:WebInspector.NavigatorView.prototype};WebInspector.SourcesSearchScope=function(workspace)
{WebInspector.SearchScope.call(this)
this._searchId=0;this._workspace=workspace;}
WebInspector.SourcesSearchScope.prototype={performIndexing:function(progress,indexingFinishedCallback)
@@ -818,7 +850,7 @@
this._view.highlightPosition(lineNumber,rule.rawLocation.columnNumber);this._view.focus();},__proto__:WebInspector.SelectionDialogContentProvider.prototype};WebInspector.TabbedEditorContainerDelegate=function(){}
WebInspector.TabbedEditorContainerDelegate.prototype={viewForFile:function(uiSourceCode){}}
WebInspector.TabbedEditorContainer=function(delegate,settingName,placeholderText)
-{WebInspector.Object.call(this);this._delegate=delegate;this._tabbedPane=new WebInspector.TabbedPane();this._tabbedPane.setPlaceholderText(placeholderText);this._tabbedPane.setTabDelegate(new WebInspector.EditorContainerTabDelegate(this));this._tabbedPane.closeableTabs=true;this._tabbedPane.element.id="scripts-editor-container-tabbed-pane";this._tabbedPane.addEventListener(WebInspector.TabbedPane.EventTypes.TabClosed,this._tabClosed,this);this._tabbedPane.addEventListener(WebInspector.TabbedPane.EventTypes.TabSelected,this._tabSelected,this);this._tabIds=new Map();this._files={};this._previouslyViewedFilesSetting=WebInspector.settings.createSetting(settingName,[]);this._history=WebInspector.TabbedEditorContainer.History.fromObject(this._previouslyViewedFilesSetting.get());}
+{WebInspector.Object.call(this);this._delegate=delegate;this._tabbedPane=new WebInspector.TabbedPane();this._tabbedPane.setPlaceholderText(placeholderText);this._tabbedPane.setTabDelegate(new WebInspector.EditorContainerTabDelegate(this));this._tabbedPane.closeableTabs=true;this._tabbedPane.element.id="sources-editor-container-tabbed-pane";this._tabbedPane.addEventListener(WebInspector.TabbedPane.EventTypes.TabClosed,this._tabClosed,this);this._tabbedPane.addEventListener(WebInspector.TabbedPane.EventTypes.TabSelected,this._tabSelected,this);this._tabIds=new Map();this._files={};this._previouslyViewedFilesSetting=WebInspector.settings.createSetting(settingName,[]);this._history=WebInspector.TabbedEditorContainer.History.fromObject(this._previouslyViewedFilesSetting.get());}
WebInspector.TabbedEditorContainer.Events={EditorSelected:"EditorSelected",EditorClosed:"EditorClosed"}
WebInspector.TabbedEditorContainer._tabId=0;WebInspector.TabbedEditorContainer.maximalPreviouslyViewedFilesCount=30;WebInspector.TabbedEditorContainer.prototype={get view()
{return this._tabbedPane;},get visibleView()
@@ -1022,18 +1054,16 @@
{var item=this._workerListElement.createChild("div","dedicated-worker-item");var link=item.createChild("a");link.textContent=url;link.href="#";link.target="_blank";link.addEventListener("click",this._workerItemClicked.bind(this,workerId),true);this._idToWorkerItem[workerId]=item;},_workerItemClicked:function(workerId,event)
{event.preventDefault();this._workerManager.openWorkerInspector(workerId);},_autoattachToWorkersClicked:function(event)
{WorkerAgent.setAutoconnectToWorkers(this._enableWorkersCheckbox.checked);},__proto__:WebInspector.SidebarPane.prototype};WebInspector.SourcesPanel=function(workspaceForTest)
-{WebInspector.Panel.call(this,"sources");this.registerRequiredCSS("sourcesPanel.css");this.registerRequiredCSS("textPrompt.css");WebInspector.settings.navigatorWasOnceHidden=WebInspector.settings.createSetting("navigatorWasOnceHidden",false);WebInspector.settings.debuggerSidebarHidden=WebInspector.settings.createSetting("debuggerSidebarHidden",false);this._workspace=workspaceForTest||WebInspector.workspace;function viewGetter()
+{WebInspector.Panel.call(this,"sources");this.registerRequiredCSS("sourcesPanel.css");this.registerRequiredCSS("textPrompt.css");WebInspector.settings.navigatorWasOnceHidden=WebInspector.settings.createSetting("navigatorWasOnceHidden",false);WebInspector.settings.debuggerSidebarHidden=WebInspector.settings.createSetting("debuggerSidebarHidden",false);WebInspector.settings.showEditorInDrawer=WebInspector.settings.createSetting("showEditorInDrawer",true);this._workspace=workspaceForTest||WebInspector.workspace;function viewGetter()
{return this.visibleView;}
-WebInspector.GoToLineDialog.install(this,viewGetter.bind(this));var helpSection=WebInspector.shortcutsScreen.section(WebInspector.UIString("Sources Panel"));this.debugToolbar=this._createDebugToolbar();const initialDebugSidebarWidth=225;const minimumDebugSidebarWidthPercent=0.5;this.createSidebarView(this.element,WebInspector.SidebarView.SidebarPosition.End,initialDebugSidebarWidth);this.splitView.element.id="scripts-split-view";this.splitView.setSidebarElementConstraints(Preferences.minScriptsSidebarWidth);this.splitView.setMainElementConstraints(minimumDebugSidebarWidthPercent);const initialNavigatorWidth=225;const minimumViewsContainerWidthPercent=0.5;this.editorView=new WebInspector.SidebarView(WebInspector.SidebarView.SidebarPosition.Start,"scriptsPanelNavigatorSidebarWidth",initialNavigatorWidth);this.editorView.element.tabIndex=0;this.editorView.setSidebarElementConstraints(Preferences.minScriptsSidebarWidth);this.editorView.setMainElementConstraints(minimumViewsContainerWidthPercent);this.editorView.show(this.splitView.mainElement);this._navigator=new WebInspector.SourcesNavigator();this._navigator.view.show(this.editorView.sidebarElement);var tabbedEditorPlaceholderText=WebInspector.isMac()?WebInspector.UIString("Hit Cmd+O to open a file"):WebInspector.UIString("Hit Ctrl+O to open a file");this._editorContentsElement=this.editorView.mainElement.createChild("div","fill");this._editorFooterElement=this.editorView.mainElement.createChild("div","inspector-footer status-bar hidden");this._editorContainer=new WebInspector.TabbedEditorContainer(this,"previouslyViewedFiles",tabbedEditorPlaceholderText);this._editorContainer.show(this._editorContentsElement);this._navigatorController=new WebInspector.NavigatorOverlayController(this.editorView,this._navigator.view,this._editorContainer.view);this._navigator.addEventListener(WebInspector.SourcesNavigator.Events.SourceSelected,this._sourceSelected,this);this._navigator.addEventListener(WebInspector.SourcesNavigator.Events.ItemSearchStarted,this._itemSearchStarted,this);this._navigator.addEventListener(WebInspector.SourcesNavigator.Events.ItemCreationRequested,this._itemCreationRequested,this);this._navigator.addEventListener(WebInspector.SourcesNavigator.Events.ItemRenamingRequested,this._itemRenamingRequested,this);this._editorContainer.addEventListener(WebInspector.TabbedEditorContainer.Events.EditorSelected,this._editorSelected,this);this._editorContainer.addEventListener(WebInspector.TabbedEditorContainer.Events.EditorClosed,this._editorClosed,this);this._debugSidebarResizeWidgetElement=this.splitView.mainElement.createChild("div","resizer-widget");this._debugSidebarResizeWidgetElement.id="scripts-debug-sidebar-resizer-widget";this.splitView.installResizer(this._debugSidebarResizeWidgetElement);this.sidebarPanes={};this.sidebarPanes.watchExpressions=new WebInspector.WatchExpressionsSidebarPane();this.sidebarPanes.callstack=new WebInspector.CallStackSidebarPane();this.sidebarPanes.callstack.addEventListener(WebInspector.CallStackSidebarPane.Events.CallFrameSelected,this._callFrameSelectedInSidebar.bind(this));this.sidebarPanes.scopechain=new WebInspector.ScopeChainSidebarPane();this.sidebarPanes.jsBreakpoints=new WebInspector.JavaScriptBreakpointsSidebarPane(WebInspector.breakpointManager,this._showSourceLocation.bind(this));this.sidebarPanes.domBreakpoints=WebInspector.domBreakpointsSidebarPane.createProxy(this);this.sidebarPanes.xhrBreakpoints=new WebInspector.XHRBreakpointsSidebarPane();this.sidebarPanes.eventListenerBreakpoints=new WebInspector.EventListenerBreakpointsSidebarPane();if(Capabilities.canInspectWorkers&&!WebInspector.WorkerManager.isWorkerFrontend()){WorkerAgent.enable();this.sidebarPanes.workerList=new WebInspector.WorkersSidebarPane(WebInspector.workerManager);}
-this.sidebarPanes.callstack.registerShortcuts(this.registerShortcuts.bind(this));this.registerShortcuts(WebInspector.SourcesPanelDescriptor.ShortcutKeys.GoToMember,this._showOutlineDialog.bind(this));this.registerShortcuts(WebInspector.SourcesPanelDescriptor.ShortcutKeys.ToggleBreakpoint,this._toggleBreakpoint.bind(this));this._toggleFormatSourceButton=new WebInspector.StatusBarButton(WebInspector.UIString("Pretty print"),"scripts-toggle-pretty-print-status-bar-item");this._toggleFormatSourceButton.toggled=false;this._toggleFormatSourceButton.addEventListener("click",this._toggleFormatSource,this);this._scriptViewStatusBarItemsContainer=document.createElement("div");this._scriptViewStatusBarItemsContainer.className="inline-block";this._scriptViewStatusBarTextContainer=document.createElement("div");this._scriptViewStatusBarTextContainer.className="inline-block";this._installDebuggerSidebarController();WebInspector.dockController.addEventListener(WebInspector.DockController.Events.DockSideChanged,this._dockSideChanged.bind(this));WebInspector.settings.splitVerticallyWhenDockedToRight.addChangeListener(this._dockSideChanged.bind(this));this._dockSideChanged();this._sourceFramesByUISourceCode=new Map();this._updateDebuggerButtons();this._pauseOnExceptionStateChanged();if(WebInspector.debuggerModel.isPaused())
-this._debuggerPaused();WebInspector.settings.pauseOnExceptionStateString.addChangeListener(this._pauseOnExceptionStateChanged,this);WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.DebuggerWasEnabled,this._debuggerWasEnabled,this);WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.DebuggerWasDisabled,this._debuggerWasDisabled,this);WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.DebuggerPaused,this._debuggerPaused,this);WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.DebuggerResumed,this._debuggerResumed,this);WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.CallFrameSelected,this._callFrameSelected,this);WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.ConsoleCommandEvaluatedInSelectedCallFrame,this._consoleCommandEvaluatedInSelectedCallFrame,this);WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.BreakpointsActiveStateChanged,this._breakpointsActiveStateChanged,this);WebInspector.startBatchUpdate();this._workspace.uiSourceCodes().forEach(this._addUISourceCode.bind(this));WebInspector.endBatchUpdate();this._workspace.addEventListener(WebInspector.Workspace.Events.UISourceCodeAdded,this._uiSourceCodeAdded,this);this._workspace.addEventListener(WebInspector.Workspace.Events.UISourceCodeRemoved,this._uiSourceCodeRemoved,this);this._workspace.addEventListener(WebInspector.Workspace.Events.ProjectWillReset,this._projectWillReset.bind(this),this);WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.GlobalObjectCleared,this._debuggerReset,this);WebInspector.advancedSearchController.registerSearchScope(new WebInspector.SourcesSearchScope(this._workspace));this._boundOnKeyUp=this._onKeyUp.bind(this);this._boundOnKeyDown=this._onKeyDown.bind(this);}
-WebInspector.SourcesPanel.prototype={get statusBarItems()
-{return[this._toggleFormatSourceButton.element,this._scriptViewStatusBarItemsContainer];},statusBarText:function()
-{return this._scriptViewStatusBarTextContainer;},defaultFocusedElement:function()
+WebInspector.GoToLineDialog.install(this,viewGetter.bind(this));var helpSection=WebInspector.shortcutsScreen.section(WebInspector.UIString("Sources Panel"));this.debugToolbar=this._createDebugToolbar();const initialDebugSidebarWidth=225;const minimumDebugSidebarWidthPercent=0.5;this.createSidebarView(this.element,WebInspector.SidebarView.SidebarPosition.End,initialDebugSidebarWidth);this.splitView.element.id="scripts-split-view";this.splitView.setSidebarElementConstraints(Preferences.minScriptsSidebarWidth);this.splitView.setMainElementConstraints(minimumDebugSidebarWidthPercent);const initialNavigatorWidth=225;const minimumViewsContainerWidthPercent=0.5;this.editorView=new WebInspector.SidebarView(WebInspector.SidebarView.SidebarPosition.Start,"scriptsPanelNavigatorSidebarWidth",initialNavigatorWidth);this.editorView.element.id="scripts-editor-split-view";this.editorView.element.tabIndex=0;this.editorView.setSidebarElementConstraints(Preferences.minScriptsSidebarWidth);this.editorView.setMainElementConstraints(minimumViewsContainerWidthPercent);this.editorView.show(this.splitView.mainElement);this._navigator=new WebInspector.SourcesNavigator();this._navigator.view.show(this.editorView.sidebarElement);var tabbedEditorPlaceholderText=WebInspector.isMac()?WebInspector.UIString("Hit Cmd+O to open a file"):WebInspector.UIString("Hit Ctrl+O to open a file");this.editorView.mainElement.addStyleClass("vbox");this.editorView.sidebarElement.addStyleClass("vbox");this.sourcesView=new WebInspector.SourcesView();this._editorContainer=new WebInspector.TabbedEditorContainer(this,"previouslyViewedFiles",tabbedEditorPlaceholderText);this._editorContainer.show(this.sourcesView.element);this._editorFooterElement=this.sourcesView.element.createChild("div","inspector-footer status-bar hidden");this._navigatorController=new WebInspector.NavigatorOverlayController(this.editorView,this._navigator.view,this._editorContainer.view);this._navigator.addEventListener(WebInspector.SourcesNavigator.Events.SourceSelected,this._sourceSelected,this);this._navigator.addEventListener(WebInspector.SourcesNavigator.Events.ItemSearchStarted,this._itemSearchStarted,this);this._navigator.addEventListener(WebInspector.SourcesNavigator.Events.ItemCreationRequested,this._itemCreationRequested,this);this._navigator.addEventListener(WebInspector.SourcesNavigator.Events.ItemRenamingRequested,this._itemRenamingRequested,this);this._editorContainer.addEventListener(WebInspector.TabbedEditorContainer.Events.EditorSelected,this._editorSelected,this);this._editorContainer.addEventListener(WebInspector.TabbedEditorContainer.Events.EditorClosed,this._editorClosed,this);this._debugSidebarResizeWidgetElement=this.splitView.mainElement.createChild("div","resizer-widget");this._debugSidebarResizeWidgetElement.id="scripts-debug-sidebar-resizer-widget";this.splitView.installResizer(this._debugSidebarResizeWidgetElement);this.sidebarPanes={};this.sidebarPanes.watchExpressions=new WebInspector.WatchExpressionsSidebarPane();this.sidebarPanes.callstack=new WebInspector.CallStackSidebarPane();this.sidebarPanes.callstack.addEventListener(WebInspector.CallStackSidebarPane.Events.CallFrameSelected,this._callFrameSelectedInSidebar.bind(this));this.sidebarPanes.scopechain=new WebInspector.ScopeChainSidebarPane();this.sidebarPanes.jsBreakpoints=new WebInspector.JavaScriptBreakpointsSidebarPane(WebInspector.breakpointManager,this._showSourceLocation.bind(this));this.sidebarPanes.domBreakpoints=WebInspector.domBreakpointsSidebarPane.createProxy(this);this.sidebarPanes.xhrBreakpoints=new WebInspector.XHRBreakpointsSidebarPane();this.sidebarPanes.eventListenerBreakpoints=new WebInspector.EventListenerBreakpointsSidebarPane();if(Capabilities.canInspectWorkers&&!WebInspector.WorkerManager.isWorkerFrontend()){WorkerAgent.enable();this.sidebarPanes.workerList=new WebInspector.WorkersSidebarPane(WebInspector.workerManager);}
+this.sidebarPanes.callstack.registerShortcuts(this.registerShortcuts.bind(this));this.registerShortcuts(WebInspector.SourcesPanelDescriptor.ShortcutKeys.GoToMember,this._showOutlineDialog.bind(this));this.registerShortcuts(WebInspector.SourcesPanelDescriptor.ShortcutKeys.ToggleBreakpoint,this._toggleBreakpoint.bind(this));this._extensionSidebarPanes=[];this._toggleFormatSourceButton=new WebInspector.StatusBarButton(WebInspector.UIString("Pretty print"),"sources-toggle-pretty-print-status-bar-item");this._toggleFormatSourceButton.toggled=false;this._toggleFormatSourceButton.addEventListener("click",this._toggleFormatSource,this);this._scriptViewStatusBarItemsContainer=document.createElement("div");this._scriptViewStatusBarItemsContainer.className="inline-block";this._scriptViewStatusBarTextContainer=document.createElement("div");this._scriptViewStatusBarTextContainer.className="inline-block";var statusBarContainerElement=this.sourcesView.element.createChild("div","sources-status-bar");statusBarContainerElement.appendChild(this._toggleFormatSourceButton.element);statusBarContainerElement.appendChild(this._scriptViewStatusBarItemsContainer);statusBarContainerElement.appendChild(this._scriptViewStatusBarTextContainer);this._installDebuggerSidebarController();WebInspector.dockController.addEventListener(WebInspector.DockController.Events.DockSideChanged,this._dockSideChanged.bind(this));WebInspector.settings.splitVerticallyWhenDockedToRight.addChangeListener(this._dockSideChanged.bind(this));this._dockSideChanged();this._sourceFramesByUISourceCode=new Map();this._updateDebuggerButtons();this._pauseOnExceptionStateChanged();if(WebInspector.debuggerModel.isPaused())
+this._showDebuggerPausedDetails();WebInspector.settings.pauseOnExceptionStateString.addChangeListener(this._pauseOnExceptionStateChanged,this);WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.DebuggerWasEnabled,this._debuggerWasEnabled,this);WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.DebuggerWasDisabled,this._debuggerWasDisabled,this);WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.DebuggerPaused,this._debuggerPaused,this);WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.DebuggerResumed,this._debuggerResumed,this);WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.CallFrameSelected,this._callFrameSelected,this);WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.ConsoleCommandEvaluatedInSelectedCallFrame,this._consoleCommandEvaluatedInSelectedCallFrame,this);WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.BreakpointsActiveStateChanged,this._breakpointsActiveStateChanged,this);WebInspector.startBatchUpdate();this._workspace.uiSourceCodes().forEach(this._addUISourceCode.bind(this));WebInspector.endBatchUpdate();this._workspace.addEventListener(WebInspector.Workspace.Events.UISourceCodeAdded,this._uiSourceCodeAdded,this);this._workspace.addEventListener(WebInspector.Workspace.Events.UISourceCodeRemoved,this._uiSourceCodeRemoved,this);this._workspace.addEventListener(WebInspector.Workspace.Events.ProjectWillReset,this._projectWillReset.bind(this),this);WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.GlobalObjectCleared,this._debuggerReset,this);WebInspector.advancedSearchController.registerSearchScope(new WebInspector.SourcesSearchScope(this._workspace));this._boundOnKeyUp=this._onKeyUp.bind(this);this._boundOnKeyDown=this._onKeyDown.bind(this);}
+WebInspector.SourcesPanel.prototype={defaultFocusedElement:function()
{return this._editorContainer.view.defaultFocusedElement()||this._navigator.view.defaultFocusedElement();},get paused()
{return this._paused;},wasShown:function()
-{WebInspector.Panel.prototype.wasShown.call(this);this._navigatorController.wasShown();this.element.addEventListener("keydown",this._boundOnKeyDown,false);this.element.addEventListener("keyup",this._boundOnKeyUp,false);},willHide:function()
-{this.element.removeEventListener("keydown",this._boundOnKeyDown,false);this.element.removeEventListener("keyup",this._boundOnKeyUp,false);WebInspector.Panel.prototype.willHide.call(this);WebInspector.closeViewInDrawer();},_uiSourceCodeAdded:function(event)
+{WebInspector.inspectorView.closeViewInDrawer("editor");this.sourcesView.show(this.editorView.mainElement);WebInspector.Panel.prototype.wasShown.call(this);this._navigatorController.wasShown();this.element.addEventListener("keydown",this._boundOnKeyDown,false);this.element.addEventListener("keyup",this._boundOnKeyUp,false);},willHide:function()
+{this.element.removeEventListener("keydown",this._boundOnKeyDown,false);this.element.removeEventListener("keyup",this._boundOnKeyUp,false);WebInspector.Panel.prototype.willHide.call(this);},_uiSourceCodeAdded:function(event)
{var uiSourceCode=(event.data);this._addUISourceCode(uiSourceCode);},_addUISourceCode:function(uiSourceCode)
{if(this._toggleFormatSourceButton.toggled)
uiSourceCode.setFormatted(true);if(uiSourceCode.project().isServiceProject())
@@ -1042,7 +1072,8 @@
{for(var i=0;i<uiSourceCodes.length;++i){this._navigator.removeUISourceCode(uiSourceCodes[i]);this._removeSourceFrame(uiSourceCodes[i]);}
this._editorContainer.removeUISourceCodes(uiSourceCodes);},_consoleCommandEvaluatedInSelectedCallFrame:function(event)
{this.sidebarPanes.scopechain.update(WebInspector.debuggerModel.selectedCallFrame());},_debuggerPaused:function()
-{var details=WebInspector.debuggerModel.debuggerPausedDetails();this._paused=true;this._waitingToPause=false;this._stepping=false;this._updateDebuggerButtons();WebInspector.inspectorView.setCurrentPanel(this);this.sidebarPanes.callstack.update(details.callFrames);if(details.reason===WebInspector.DebuggerModel.BreakReason.DOM){WebInspector.domBreakpointsSidebarPane.highlightBreakpoint(details.auxData);function didCreateBreakpointHitStatusMessage(element)
+{WebInspector.inspectorView.setCurrentPanel(this);this._showDebuggerPausedDetails();},_showDebuggerPausedDetails:function()
+{var details=WebInspector.debuggerModel.debuggerPausedDetails();this._paused=true;this._waitingToPause=false;this._stepping=false;this._updateDebuggerButtons();this.sidebarPanes.callstack.update(details.callFrames);if(details.reason===WebInspector.DebuggerModel.BreakReason.DOM){WebInspector.domBreakpointsSidebarPane.highlightBreakpoint(details.auxData);function didCreateBreakpointHitStatusMessage(element)
{this.sidebarPanes.callstack.setStatus(element);}
WebInspector.domBreakpointsSidebarPane.createBreakpointHitStatusMessage(details.auxData,didCreateBreakpointHitStatusMessage.bind(this));}else if(details.reason===WebInspector.DebuggerModel.BreakReason.EventListener){var eventName=details.auxData.eventName;this.sidebarPanes.eventListenerBreakpoints.highlightBreakpoint(details.auxData.eventName);var eventNameForUI=WebInspector.EventListenerBreakpointsSidebarPane.eventNameForUI(eventName,details.auxData);this.sidebarPanes.callstack.setStatus(WebInspector.UIString("Paused on a \"%s\" Event Listener.",eventNameForUI));}else if(details.reason===WebInspector.DebuggerModel.BreakReason.XHR){this.sidebarPanes.xhrBreakpoints.highlightBreakpoint(details.auxData["breakpointURL"]);this.sidebarPanes.callstack.setStatus(WebInspector.UIString("Paused on a XMLHttpRequest."));}else if(details.reason===WebInspector.DebuggerModel.BreakReason.Exception)
this.sidebarPanes.callstack.setStatus(WebInspector.UIString("Paused on exception: '%s'.",details.auxData.description));else if(details.reason===WebInspector.DebuggerModel.BreakReason.Assert)
@@ -1064,24 +1095,30 @@
{return this._editorContainer.visibleView;},_updateScriptViewStatusBarItems:function()
{this._scriptViewStatusBarItemsContainer.removeChildren();this._scriptViewStatusBarTextContainer.removeChildren();var sourceFrame=this.visibleView;if(sourceFrame){var statusBarItems=sourceFrame.statusBarItems()||[];for(var i=0;i<statusBarItems.length;++i)
this._scriptViewStatusBarItemsContainer.appendChild(statusBarItems[i]);var statusBarText=sourceFrame.statusBarText();if(statusBarText)
-this._scriptViewStatusBarTextContainer.appendChild(statusBarText);}},canShowAnchorLocation:function(anchor)
-{if(WebInspector.debuggerModel.debuggerEnabled()&&anchor.uiSourceCode)
-return true;var uiSourceCode=WebInspector.workspace.uiSourceCodeForURL(anchor.href);if(uiSourceCode){anchor.uiSourceCode=uiSourceCode;return true;}
-return false;},showAnchorLocation:function(anchor)
-{this._showSourceLocation(anchor.uiSourceCode,anchor.lineNumber,anchor.columnNumber);},showUISourceCode:function(uiSourceCode,lineNumber,columnNumber)
-{this._showSourceLocation(uiSourceCode,lineNumber,columnNumber);},currentUISourceCode:function()
-{return this._currentUISourceCode;},showUILocation:function(uiLocation)
-{this._showSourceLocation(uiLocation.uiSourceCode,uiLocation.lineNumber,uiLocation.columnNumber);},_showSourceLocation:function(uiSourceCode,lineNumber,columnNumber)
-{var sourceFrame=this._showFile(uiSourceCode);if(typeof lineNumber==="number")
+this._scriptViewStatusBarTextContainer.appendChild(statusBarText);}},showAnchorLocation:function(anchor)
+{if(!anchor.uiSourceCode){var uiSourceCode=WebInspector.workspace.uiSourceCodeForURL(anchor.href);if(uiSourceCode)
+anchor.uiSourceCode=uiSourceCode;}
+if(!anchor.uiSourceCode)
+return false;this._showSourceLocation(anchor.uiSourceCode,anchor.lineNumber,anchor.columnNumber);return true;},showUISourceCode:function(uiSourceCode,lineNumber,columnNumber,forceShowInPanel)
+{this._showSourceLocation(uiSourceCode,lineNumber,columnNumber,forceShowInPanel);},_showEditor:function(forceShowInPanel)
+{if(this.sourcesView.isShowing())
+return;if(this._canShowEditorInDrawer()&&!forceShowInPanel){var drawerEditorView=new WebInspector.DrawerEditorView();this.sourcesView.show(drawerEditorView.element);WebInspector.inspectorView.showCloseableViewInDrawer("editor",WebInspector.UIString("Editor"),drawerEditorView);}else{WebInspector.showPanel("sources");}},currentUISourceCode:function()
+{return this._currentUISourceCode;},showUILocation:function(uiLocation,forceShowInPanel)
+{this._showSourceLocation(uiLocation.uiSourceCode,uiLocation.lineNumber,uiLocation.columnNumber,forceShowInPanel);},_canShowEditorInDrawer:function()
+{return WebInspector.experimentsSettings.showEditorInDrawer.isEnabled()&&WebInspector.settings.showEditorInDrawer.get();},_showSourceLocation:function(uiSourceCode,lineNumber,columnNumber,forceShowInPanel)
+{this._showEditor(forceShowInPanel);var sourceFrame=this._showFile(uiSourceCode);if(typeof lineNumber==="number")
sourceFrame.highlightPosition(lineNumber,columnNumber);sourceFrame.focus();WebInspector.notifications.dispatchEventToListeners(WebInspector.UserMetrics.UserAction,{action:WebInspector.UserMetrics.UserActionNames.OpenSourceLink,url:uiSourceCode.originURL(),lineNumber:lineNumber});},_showFile:function(uiSourceCode)
{var sourceFrame=this._getOrCreateSourceFrame(uiSourceCode);if(this._currentUISourceCode===uiSourceCode)
return sourceFrame;this._currentUISourceCode=uiSourceCode;if(!uiSourceCode.project().isServiceProject())
this._navigator.revealUISourceCode(uiSourceCode,true);this._editorContainer.showFile(uiSourceCode);this._updateScriptViewStatusBarItems();if(this._currentUISourceCode.project().type()===WebInspector.projectTypes.Snippets)
this._runSnippetButton.element.removeStyleClass("hidden");else
this._runSnippetButton.element.addStyleClass("hidden");return sourceFrame;},_createSourceFrame:function(uiSourceCode)
-{var sourceFrame;switch(uiSourceCode.contentType()){case WebInspector.resourceTypes.Script:sourceFrame=new WebInspector.JavaScriptSourceFrame(this,uiSourceCode);break;case WebInspector.resourceTypes.Document:sourceFrame=new WebInspector.JavaScriptSourceFrame(this,uiSourceCode);break;case WebInspector.resourceTypes.Stylesheet:default:sourceFrame=new WebInspector.UISourceCodeFrame(uiSourceCode);break;}
-this._sourceFramesByUISourceCode.put(uiSourceCode,sourceFrame);return sourceFrame;},_getOrCreateSourceFrame:function(uiSourceCode)
-{return this._sourceFramesByUISourceCode.get(uiSourceCode)||this._createSourceFrame(uiSourceCode);},viewForFile:function(uiSourceCode)
+{var sourceFrame;switch(uiSourceCode.contentType()){case WebInspector.resourceTypes.Script:sourceFrame=new WebInspector.JavaScriptSourceFrame(this,uiSourceCode);break;case WebInspector.resourceTypes.Document:sourceFrame=new WebInspector.JavaScriptSourceFrame(this,uiSourceCode);break;case WebInspector.resourceTypes.Stylesheet:sourceFrame=new WebInspector.CSSSourceFrame(uiSourceCode);break;default:sourceFrame=new WebInspector.UISourceCodeFrame(uiSourceCode);break;}
+sourceFrame.setHighlighterType(uiSourceCode.highlighterType());this._sourceFramesByUISourceCode.put(uiSourceCode,sourceFrame);return sourceFrame;},_getOrCreateSourceFrame:function(uiSourceCode)
+{return this._sourceFramesByUISourceCode.get(uiSourceCode)||this._createSourceFrame(uiSourceCode);},_sourceFrameMatchesUISourceCode:function(sourceFrame,uiSourceCode)
+{switch(uiSourceCode.contentType()){case WebInspector.resourceTypes.Script:case WebInspector.resourceTypes.Document:return sourceFrame instanceof WebInspector.JavaScriptSourceFrame;case WebInspector.resourceTypes.Stylesheet:return sourceFrame instanceof WebInspector.CSSSourceFrame;default:return!(sourceFrame instanceof WebInspector.JavaScriptSourceFrame);}},_recreateSourceFrameIfNeeded:function(uiSourceCode)
+{var oldSourceFrame=this._sourceFramesByUISourceCode.get(uiSourceCode);if(!oldSourceFrame)
+return;if(this._sourceFrameMatchesUISourceCode(oldSourceFrame,uiSourceCode)){oldSourceFrame.setHighlighterType(uiSourceCode.highlighterType());}else{this._editorContainer.removeUISourceCode(uiSourceCode);this._removeSourceFrame(uiSourceCode);}},viewForFile:function(uiSourceCode)
{return this._getOrCreateSourceFrame(uiSourceCode);},_removeSourceFrame:function(uiSourceCode)
{var sourceFrame=this._sourceFramesByUISourceCode.get(uiSourceCode);if(!sourceFrame)
return;this._sourceFramesByUISourceCode.remove(uiSourceCode);sourceFrame.dispose();},_clearCurrentExecutionLine:function()
@@ -1110,14 +1147,14 @@
{var nextStateMap={};var stateEnum=WebInspector.DebuggerModel.PauseOnExceptionsState;nextStateMap[stateEnum.DontPauseOnExceptions]=stateEnum.PauseOnAllExceptions;nextStateMap[stateEnum.PauseOnAllExceptions]=stateEnum.PauseOnUncaughtExceptions;nextStateMap[stateEnum.PauseOnUncaughtExceptions]=stateEnum.DontPauseOnExceptions;WebInspector.settings.pauseOnExceptionStateString.set(nextStateMap[this._pauseOnExceptionButton.state]);},_runSnippet:function(event)
{if(this._currentUISourceCode.project().type()!==WebInspector.projectTypes.Snippets)
return false;WebInspector.scriptSnippetModel.evaluateScriptSnippet(this._currentUISourceCode);return true;},_togglePause:function(event)
-{if(this._paused){delete this._skipExecutionLineRevealing;this._paused=false;this._waitingToPause=false;DebuggerAgent.resume();}else{this._stepping=false;this._waitingToPause=true;DebuggerAgent.setSkipAllPauses(false);DebuggerAgent.pause();}
+{if(this._paused){delete this._skipExecutionLineRevealing;this._paused=false;this._waitingToPause=false;WebInspector.debuggerModel.resume();}else{this._stepping=false;this._waitingToPause=true;WebInspector.debuggerModel.skipAllPauses(false);DebuggerAgent.pause();}
this._clearInterface();return true;},_longResume:function(event)
{if(!this._paused)
-return true;this._paused=false;this._waitingToPause=false;DebuggerAgent.setSkipAllPauses(true,true);setTimeout(DebuggerAgent.setSkipAllPauses.bind(DebuggerAgent,false),500);DebuggerAgent.resume();this._clearInterface();return true;},_stepOverClicked:function(event)
+return true;this._paused=false;this._waitingToPause=false;WebInspector.debuggerModel.skipAllPausesUntilReloadOrTimeout(500);WebInspector.debuggerModel.resume();this._clearInterface();return true;},_stepOverClicked:function(event)
{if(!this._paused)
-return true;delete this._skipExecutionLineRevealing;this._paused=false;this._stepping=true;this._clearInterface();DebuggerAgent.stepOver();return true;},_stepIntoClicked:function(event)
+return true;delete this._skipExecutionLineRevealing;this._paused=false;this._stepping=true;this._clearInterface();WebInspector.debuggerModel.stepOver();return true;},_stepIntoClicked:function(event)
{if(!this._paused)
-return true;delete this._skipExecutionLineRevealing;this._paused=false;this._stepping=true;this._clearInterface();DebuggerAgent.stepInto();return true;},_stepIntoSelectionClicked:function(event)
+return true;delete this._skipExecutionLineRevealing;this._paused=false;this._stepping=true;this._clearInterface();WebInspector.debuggerModel.stepInto();return true;},_stepIntoSelectionClicked:function(event)
{if(!this._paused)
return true;if(this._executionSourceFrame){var stepIntoMarkup=this._executionSourceFrame.stepIntoMarkup();if(stepIntoMarkup)
stepIntoMarkup.iterateSelection(event.shiftKey);}
@@ -1125,7 +1162,7 @@
{if(!this._paused)
return;delete this._skipExecutionLineRevealing;this._paused=false;this._stepping=true;this._clearInterface();WebInspector.debuggerModel.stepIntoSelection(rawLocation);},_stepOutClicked:function(event)
{if(!this._paused)
-return true;delete this._skipExecutionLineRevealing;this._paused=false;this._stepping=true;this._clearInterface();DebuggerAgent.stepOut();return true;},_callFrameSelectedInSidebar:function(event)
+return true;delete this._skipExecutionLineRevealing;this._paused=false;this._stepping=true;this._clearInterface();WebInspector.debuggerModel.stepOut();return true;},_callFrameSelectedInSidebar:function(event)
{var callFrame=(event.data);delete this._skipExecutionLineRevealing;WebInspector.debuggerModel.setSelectedCallFrame(callFrame);},continueToLocation:function(rawLocation)
{if(!this._paused)
return;delete this._skipExecutionLineRevealing;this._paused=false;this._stepping=true;this._clearInterface();WebInspector.debuggerModel.continueToLocation(rawLocation);},_toggleBreakpointsClicked:function(event)
@@ -1179,17 +1216,23 @@
{this._toggleDebuggerSidebarButton.state=show?"right":"left";this._toggleDebuggerSidebarButton.title=show?WebInspector.UIString("Hide debugger"):WebInspector.UIString("Show debugger");if(show)
this.splitView.showSidebarElement();else
this.splitView.hideSidebarElement();this._debugSidebarResizeWidgetElement.enableStyleClass("hidden",!show);WebInspector.settings.debuggerSidebarHidden.set(!show);},_itemCreationRequested:function(event)
-{var project=event.data.project;var path=event.data.path;var filePath;var shouldHideNavigator;var uiSourceCode;project.createFile(path,null,fileCreated.bind(this));function fileCreated(path)
+{var project=event.data.project;var path=event.data.path;var uiSourceCodeToCopy=event.data.uiSourceCode;var filePath;var shouldHideNavigator;var uiSourceCode;if(uiSourceCodeToCopy){function contentLoaded(content)
+{createFile.call(this,content||"");}
+uiSourceCodeToCopy.requestContent(contentLoaded.bind(this));}else{createFile.call(this);}
+function createFile(content)
+{project.createFile(path,null,content||"",fileCreated.bind(this));}
+function fileCreated(path)
{if(!path)
return;filePath=path;uiSourceCode=project.uiSourceCode(filePath);this._showSourceLocation(uiSourceCode);shouldHideNavigator=!this._navigatorController.isNavigatorPinned();if(this._navigatorController.isNavigatorHidden())
this._navigatorController.showNavigatorOverlay();this._navigator.rename(uiSourceCode,callback.bind(this));}
function callback(committed)
{if(shouldHideNavigator)
this._navigatorController.hideNavigatorOverlay();if(!committed){project.deleteFile(uiSourceCode);return;}
-this._showSourceLocation(uiSourceCode);}},_itemRenamingRequested:function(event)
+this._recreateSourceFrameIfNeeded(uiSourceCode);this._navigator.updateIcon(uiSourceCode);this._showSourceLocation(uiSourceCode);}},_itemRenamingRequested:function(event)
{var uiSourceCode=(event.data);var shouldHideNavigator=!this._navigatorController.isNavigatorPinned();if(this._navigatorController.isNavigatorHidden())
this._navigatorController.showNavigatorOverlay();this._navigator.rename(uiSourceCode,callback.bind(this));function callback(committed)
-{if(shouldHideNavigator&&committed){this._navigatorController.hideNavigatorOverlay();this._showSourceLocation(uiSourceCode);}}},_showLocalHistory:function(uiSourceCode)
+{if(shouldHideNavigator&&committed)
+this._navigatorController.hideNavigatorOverlay();this._recreateSourceFrameIfNeeded(uiSourceCode);this._navigator.updateIcon(uiSourceCode);this._showSourceLocation(uiSourceCode);}},_showLocalHistory:function(uiSourceCode)
{WebInspector.RevisionHistoryView.showHistory(uiSourceCode);},appendApplicableItems:function(event,contextMenu,target)
{this._appendUISourceCodeItems(contextMenu,target);this._appendFunctionItems(contextMenu,target);},_mapFileSystemToNetwork:function(uiSourceCode)
{WebInspector.SelectUISourceCodeForProjectTypeDialog.show(uiSourceCode.name(),WebInspector.projectTypes.Network,mapFileSystemToNetwork.bind(this),this.editorView.mainElement)
@@ -1225,10 +1268,19 @@
{if(this.sidebarPaneView&&vertically===!this.splitView.isVertical())
return;if(this.sidebarPaneView)
this.sidebarPaneView.detach();this.splitView.setVertical(!vertically);if(!vertically){this.sidebarPaneView=new WebInspector.SidebarPaneStack();for(var pane in this.sidebarPanes)
-this.sidebarPaneView.addPane(this.sidebarPanes[pane]);this.sidebarElement.appendChild(this.debugToolbar);}else{this._enableDebuggerSidebar(true);this.sidebarPaneView=new WebInspector.SplitView(true,this.name+"PanelSplitSidebarRatio",0.5);var group1=new WebInspector.SidebarPaneStack();group1.show(this.sidebarPaneView.firstElement());group1.element.id="scripts-sidebar-stack-pane";group1.addPane(this.sidebarPanes.callstack);group1.addPane(this.sidebarPanes.jsBreakpoints);group1.addPane(this.sidebarPanes.domBreakpoints);group1.addPane(this.sidebarPanes.xhrBreakpoints);group1.addPane(this.sidebarPanes.eventListenerBreakpoints);if(this.sidebarPanes.workerList)
-group1.addPane(this.sidebarPanes.workerList);var group2=new WebInspector.SidebarTabbedPane();group2.show(this.sidebarPaneView.secondElement());group2.addPane(this.sidebarPanes.scopechain);group2.addPane(this.sidebarPanes.watchExpressions);this.sidebarPaneView.firstElement().appendChild(this.debugToolbar);}
-this.sidebarPaneView.element.id="scripts-debug-sidebar-contents";this.sidebarPaneView.show(this.splitView.sidebarElement);this.sidebarPanes.scopechain.expand();this.sidebarPanes.jsBreakpoints.expand();this.sidebarPanes.callstack.expand();if(WebInspector.settings.watchExpressions.get().length>0)
+this.sidebarPaneView.addPane(this.sidebarPanes[pane]);this._extensionSidebarPanesContainer=this.sidebarPaneView;this.sidebarElement.appendChild(this.debugToolbar);}else{this._enableDebuggerSidebar(true);this.sidebarPaneView=new WebInspector.SplitView(true,this.name+"PanelSplitSidebarRatio",0.5);var group1=new WebInspector.SidebarPaneStack();group1.show(this.sidebarPaneView.firstElement());group1.element.id="scripts-sidebar-stack-pane";group1.addPane(this.sidebarPanes.callstack);group1.addPane(this.sidebarPanes.jsBreakpoints);group1.addPane(this.sidebarPanes.domBreakpoints);group1.addPane(this.sidebarPanes.xhrBreakpoints);group1.addPane(this.sidebarPanes.eventListenerBreakpoints);if(this.sidebarPanes.workerList)
+group1.addPane(this.sidebarPanes.workerList);var group2=new WebInspector.SidebarTabbedPane();group2.show(this.sidebarPaneView.secondElement());group2.addPane(this.sidebarPanes.scopechain);group2.addPane(this.sidebarPanes.watchExpressions);this._extensionSidebarPanesContainer=group2;this.sidebarPaneView.firstElement().appendChild(this.debugToolbar);}
+for(var i=0;i<this._extensionSidebarPanes.length;++i)
+this._extensionSidebarPanesContainer.addPane(this._extensionSidebarPanes[i]);this.sidebarPaneView.element.id="scripts-debug-sidebar-contents";this.sidebarPaneView.show(this.splitView.sidebarElement);this.sidebarPanes.scopechain.expand();this.sidebarPanes.jsBreakpoints.expand();this.sidebarPanes.callstack.expand();if(WebInspector.settings.watchExpressions.get().length>0)
this.sidebarPanes.watchExpressions.expand();},canSetFooterElement:function()
{return true;},setFooterElement:function(element)
-{if(element){this._editorFooterElement.removeStyleClass("hidden");this._editorFooterElement.appendChild(element);this._editorContentsElement.style.bottom=this._editorFooterElement.offsetHeight+"px";}else{this._editorFooterElement.addStyleClass("hidden");this._editorFooterElement.removeChildren();this._editorContentsElement.style.bottom=0;}
-this.doResize();},__proto__:WebInspector.Panel.prototype}
+{if(element){this._editorFooterElement.removeStyleClass("hidden");this._editorFooterElement.appendChild(element);}else{this._editorFooterElement.addStyleClass("hidden");this._editorFooterElement.removeChildren();}
+this.doResize();},addExtensionSidebarPane:function(id,pane)
+{this._extensionSidebarPanes.push(pane);this._extensionSidebarPanesContainer.addPane(pane);this.setHideOnDetach();},get tabbedEditorContainer()
+{return this._editorContainer;},__proto__:WebInspector.Panel.prototype}
+WebInspector.SourcesView=function()
+{WebInspector.View.call(this);this.registerRequiredCSS("sourcesView.css");this.element.id="sources-panel-sources-view";this.element.addStyleClass("vbox");}
+WebInspector.SourcesView.prototype={__proto__:WebInspector.View.prototype}
+WebInspector.DrawerEditorView=function()
+{WebInspector.View.call(this);this.element.id="drawer-editor-view";this.element.addStyleClass("vbox");}
+WebInspector.DrawerEditorView.prototype={__proto__:WebInspector.View.prototype}
« no previous file with comments | « chrome_linux/resources/inspector/ScriptsPanel.js ('k') | chrome_linux/resources/inspector/TimelinePanel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698