Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * @constructor | 6 * @constructor |
| 7 * @extends {WebInspector.Widget} | 7 * @extends {WebInspector.Widget} |
| 8 * @implements {WebInspector.TargetManager.Observer} | 8 * @implements {WebInspector.TargetManager.Observer} |
| 9 * @param {!WebInspector.Setting} widthSetting | 9 * @param {!WebInspector.Setting} widthSetting |
| 10 */ | 10 */ |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 132 var mediaQueryMarker = event.target.enclosingNodeOrSelfWithClass("media- inspector-marker"); | 132 var mediaQueryMarker = event.target.enclosingNodeOrSelfWithClass("media- inspector-marker"); |
| 133 if (!mediaQueryMarker) | 133 if (!mediaQueryMarker) |
| 134 return; | 134 return; |
| 135 | 135 |
| 136 var locations = mediaQueryMarker._locations; | 136 var locations = mediaQueryMarker._locations; |
| 137 var uiLocations = new Map(); | 137 var uiLocations = new Map(); |
| 138 for (var i = 0; i < locations.length; ++i) { | 138 for (var i = 0; i < locations.length; ++i) { |
| 139 var uiLocation = WebInspector.cssWorkspaceBinding.rawLocationToUILoc ation(locations[i]); | 139 var uiLocation = WebInspector.cssWorkspaceBinding.rawLocationToUILoc ation(locations[i]); |
| 140 if (!uiLocation) | 140 if (!uiLocation) |
| 141 continue; | 141 continue; |
| 142 var descriptor = String.sprintf("%s:%d:%d", uiLocation.uiSourceCode. uri(), uiLocation.lineNumber + 1, uiLocation.columnNumber + 1); | 142 var descriptor = String.sprintf("%s:%d:%d", uiLocation.uiSourceCode. url(), uiLocation.lineNumber + 1, uiLocation.columnNumber + 1); |
|
dgozman
2016/01/08 20:22:06
I think displayName suits better.
pfeldman
2016/01/08 23:56:32
This is location like in console, it should not us
| |
| 143 uiLocations.set(descriptor, uiLocation); | 143 uiLocations.set(descriptor, uiLocation); |
| 144 } | 144 } |
| 145 | 145 |
| 146 var contextMenuItems = uiLocations.keysArray().sort(); | 146 var contextMenuItems = uiLocations.keysArray().sort(); |
| 147 var contextMenu = new WebInspector.ContextMenu(event); | 147 var contextMenu = new WebInspector.ContextMenu(event); |
| 148 var subMenuItem = contextMenu.appendSubMenuItem(WebInspector.UIString.ca pitalize("Reveal in ^source ^code")); | 148 var subMenuItem = contextMenu.appendSubMenuItem(WebInspector.UIString.ca pitalize("Reveal in ^source ^code")); |
| 149 for (var i = 0; i < contextMenuItems.length; ++i) { | 149 for (var i = 0; i < contextMenuItems.length; ++i) { |
| 150 var title = contextMenuItems[i]; | 150 var title = contextMenuItems[i]; |
| 151 subMenuItem.appendItem(title, this._revealSourceLocation.bind(this, /** @type {!WebInspector.UILocation} */(uiLocations.get(title)))); | 151 subMenuItem.appendItem(title, this._revealSourceLocation.bind(this, /** @type {!WebInspector.UILocation} */(uiLocations.get(title)))); |
| 152 } | 152 } |
| (...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 482 }, | 482 }, |
| 483 | 483 |
| 484 /** | 484 /** |
| 485 * @return {boolean} | 485 * @return {boolean} |
| 486 */ | 486 */ |
| 487 active: function() | 487 active: function() |
| 488 { | 488 { |
| 489 return this._active; | 489 return this._active; |
| 490 } | 490 } |
| 491 } | 491 } |
| OLD | NEW |