OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. |
3 * Copyright (C) 2007 Matt Lilek (pewtermoose@gmail.com). | 3 * Copyright (C) 2007 Matt Lilek (pewtermoose@gmail.com). |
4 * Copyright (C) 2009 Joseph Pecoraro | 4 * Copyright (C) 2009 Joseph Pecoraro |
5 * | 5 * |
6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
8 * are met: | 8 * are met: |
9 * | 9 * |
10 * 1. Redistributions of source code must retain the above copyright | 10 * 1. Redistributions of source code must retain the above copyright |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 return ""; | 55 return ""; |
56 | 56 |
57 var resource = WebInspector.resourceForURL(url); | 57 var resource = WebInspector.resourceForURL(url); |
58 if (resource) | 58 if (resource) |
59 return resource.displayName; | 59 return resource.displayName; |
60 | 60 |
61 var uiSourceCode = WebInspector.workspace.uiSourceCodeForURL(url); | 61 var uiSourceCode = WebInspector.workspace.uiSourceCodeForURL(url); |
62 if (uiSourceCode) | 62 if (uiSourceCode) |
63 return uiSourceCode.displayName(); | 63 return uiSourceCode.displayName(); |
64 | 64 |
65 if (!WebInspector.resourceTreeModel.inspectedPageURL()) | 65 if (!WebInspector.targetManager.inspectedPageURL()) |
66 return url.trimURL(""); | 66 return url.trimURL(""); |
67 | 67 |
68 var parsedURL = WebInspector.resourceTreeModel.inspectedPageURL().asParsedUR
L(); | 68 var parsedURL = WebInspector.targetManager.inspectedPageURL().asParsedURL(); |
69 var lastPathComponent = parsedURL ? parsedURL.lastPathComponent : parsedURL; | 69 var lastPathComponent = parsedURL ? parsedURL.lastPathComponent : parsedURL; |
70 var index = WebInspector.resourceTreeModel.inspectedPageURL().indexOf(lastPa
thComponent); | 70 var index = WebInspector.targetManager.inspectedPageURL().indexOf(lastPathCo
mponent); |
71 if (index !== -1 && index + lastPathComponent.length === WebInspector.resour
ceTreeModel.inspectedPageURL().length) { | 71 if (index !== -1 && index + lastPathComponent.length === WebInspector.target
Manager.inspectedPageURL().length) { |
72 var baseURL = WebInspector.resourceTreeModel.inspectedPageURL().substrin
g(0, index); | 72 var baseURL = WebInspector.targetManager.inspectedPageURL().substring(0,
index); |
73 if (url.startsWith(baseURL)) | 73 if (url.startsWith(baseURL)) |
74 return url.substring(index); | 74 return url.substring(index); |
75 } | 75 } |
76 | 76 |
77 if (!parsedURL) | 77 if (!parsedURL) |
78 return url; | 78 return url; |
79 | 79 |
80 var displayName = url.trimURL(parsedURL.host); | 80 var displayName = url.trimURL(parsedURL.host); |
81 return displayName === "/" ? parsedURL.host + "/" : displayName; | 81 return displayName === "/" ? parsedURL.host + "/" : displayName; |
82 } | 82 } |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 /** | 220 /** |
221 * @param {!WebInspector.NetworkRequest} request | 221 * @param {!WebInspector.NetworkRequest} request |
222 * @return {!Element} | 222 * @return {!Element} |
223 */ | 223 */ |
224 WebInspector.linkifyRequestAsNode = function(request) | 224 WebInspector.linkifyRequestAsNode = function(request) |
225 { | 225 { |
226 var anchor = WebInspector.linkifyURLAsNode(request.url); | 226 var anchor = WebInspector.linkifyURLAsNode(request.url); |
227 anchor.requestId = request.requestId; | 227 anchor.requestId = request.requestId; |
228 return anchor; | 228 return anchor; |
229 } | 229 } |
OLD | NEW |