| 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.View} | 7 * @extends {WebInspector.View} |
| 8 * @implements {WebInspector.TargetManager.Observer} | 8 * @implements {WebInspector.TargetManager.Observer} |
| 9 */ | 9 */ |
| 10 WebInspector.MediaQueryInspector = function() | 10 WebInspector.MediaQueryInspector = function() |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 var uiLocations = new StringMap(); | 136 var uiLocations = new StringMap(); |
| 137 for (var i = 0; i < locations.length; ++i) { | 137 for (var i = 0; i < locations.length; ++i) { |
| 138 var uiLocation = WebInspector.cssWorkspaceBinding.rawLocationToUILoc
ation(locations[i]); | 138 var uiLocation = WebInspector.cssWorkspaceBinding.rawLocationToUILoc
ation(locations[i]); |
| 139 if (!uiLocation) | 139 if (!uiLocation) |
| 140 continue; | 140 continue; |
| 141 var descriptor = String.sprintf("%s:%d:%d", uiLocation.uiSourceCode.
uri(), uiLocation.lineNumber + 1, uiLocation.columnNumber + 1); | 141 var descriptor = String.sprintf("%s:%d:%d", uiLocation.uiSourceCode.
uri(), uiLocation.lineNumber + 1, uiLocation.columnNumber + 1); |
| 142 uiLocations.set(descriptor, uiLocation); | 142 uiLocations.set(descriptor, uiLocation); |
| 143 } | 143 } |
| 144 | 144 |
| 145 var contextMenuItems = uiLocations.keys().sort(); | 145 var contextMenuItems = uiLocations.keys().sort(); |
| 146 var contextMenu = new WebInspector.ContextMenu(event, this.element.owner
Document.defaultView); | 146 var contextMenu = new WebInspector.ContextMenu(event); |
| 147 var subMenuItem = contextMenu.appendSubMenuItem(WebInspector.UIString(We
bInspector.useLowerCaseMenuTitles() ? "Reveal in source code" : "Reveal In Sourc
e Code")); | 147 var subMenuItem = contextMenu.appendSubMenuItem(WebInspector.UIString(We
bInspector.useLowerCaseMenuTitles() ? "Reveal in source code" : "Reveal In Sourc
e Code")); |
| 148 for (var i = 0; i < contextMenuItems.length; ++i) { | 148 for (var i = 0; i < contextMenuItems.length; ++i) { |
| 149 var title = contextMenuItems[i]; | 149 var title = contextMenuItems[i]; |
| 150 subMenuItem.appendItem(title, this._revealSourceLocation.bind(this,
/** @type {!WebInspector.UILocation} */(uiLocations.get(title)))); | 150 subMenuItem.appendItem(title, this._revealSourceLocation.bind(this,
/** @type {!WebInspector.UILocation} */(uiLocations.get(title)))); |
| 151 } | 151 } |
| 152 contextMenu.show(); | 152 contextMenu.show(); |
| 153 }, | 153 }, |
| 154 | 154 |
| 155 /** | 155 /** |
| 156 * @param {!WebInspector.UILocation} location | 156 * @param {!WebInspector.UILocation} location |
| (...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 499 }, | 499 }, |
| 500 | 500 |
| 501 /** | 501 /** |
| 502 * @return {boolean} | 502 * @return {boolean} |
| 503 */ | 503 */ |
| 504 active: function() | 504 active: function() |
| 505 { | 505 { |
| 506 return this._active; | 506 return this._active; |
| 507 } | 507 } |
| 508 } | 508 } |
| OLD | NEW |