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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/ui/UIUtils.js

Issue 1952933002: DevTools: extract the report view to reuse in app manifest and service worker pane. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tests fixed Created 4 years, 7 months 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. 3 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
4 * Copyright (C) 2007 Matt Lilek (pewtermoose@gmail.com). 4 * Copyright (C) 2007 Matt Lilek (pewtermoose@gmail.com).
5 * Copyright (C) 2009 Joseph Pecoraro 5 * Copyright (C) 2009 Joseph Pecoraro
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 10 *
(...skipping 1832 matching lines...) Expand 10 before | Expand all | Expand 10 after
1843 [NetworkAgent.ResourcePriority.Low, WebInspector.UIString("Low")], 1843 [NetworkAgent.ResourcePriority.Low, WebInspector.UIString("Low")],
1844 [NetworkAgent.ResourcePriority.Medium, WebInspector.UIString("Medium ")], 1844 [NetworkAgent.ResourcePriority.Medium, WebInspector.UIString("Medium ")],
1845 [NetworkAgent.ResourcePriority.High, WebInspector.UIString("High")], 1845 [NetworkAgent.ResourcePriority.High, WebInspector.UIString("High")],
1846 [NetworkAgent.ResourcePriority.VeryHigh, WebInspector.UIString("High est")] 1846 [NetworkAgent.ResourcePriority.VeryHigh, WebInspector.UIString("High est")]
1847 ]); 1847 ]);
1848 WebInspector.uiLabelForPriority._priorityToUILabel = labelMap; 1848 WebInspector.uiLabelForPriority._priorityToUILabel = labelMap;
1849 } 1849 }
1850 return labelMap.get(priority) || WebInspector.UIString("Unknown"); 1850 return labelMap.get(priority) || WebInspector.UIString("Unknown");
1851 } 1851 }
1852 1852
1853 /**
1854 * @param {string} url
1855 * @param {string=} linkText
1856 * @param {string=} classes
1857 * @param {boolean=} isExternal
1858 * @param {string=} tooltipText
1859 * @return {!Element}
1860 */
1861 WebInspector.linkifyURLAsNode = function(url, linkText, classes, isExternal, too ltipText)
1862 {
1863 if (!linkText)
1864 linkText = url;
1865
1866 var a = createElementWithClass("a", classes);
1867 var href = url;
1868 if (url.trim().toLowerCase().startsWith("javascript:"))
1869 href = null;
1870 if (isExternal && WebInspector.ParsedURL.isRelativeURL(url))
1871 href = null;
1872 if (href !== null) {
1873 a.href = href;
1874 a.classList.add(isExternal ? "webkit-html-external-link" : "webkit-html- resource-link");
1875 }
1876 if (!tooltipText && linkText !== url)
1877 a.title = url;
1878 else if (tooltipText)
1879 a.title = tooltipText;
1880 a.textContent = linkText.trimMiddle(150);
1881 if (isExternal)
1882 a.setAttribute("target", "_blank");
1883
1884 return a;
1885 }
1886
1887 /**
1888 * @param {string} article
1889 * @param {string} title
1890 * @return {!Element}
1891 */
1892 WebInspector.linkifyDocumentationURLAsNode = function(article, title)
1893 {
1894 return WebInspector.linkifyURLAsNode("https://developers.google.com/web/tool s/chrome-devtools/" + article, title, undefined, true);
1895 }
1896
1853 /** @type {!WebInspector.ThemeSupport} */ 1897 /** @type {!WebInspector.ThemeSupport} */
1854 WebInspector.themeSupport; 1898 WebInspector.themeSupport;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698