Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 1922 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1933 event.consume(true); | 1933 event.consume(true); |
| 1934 InspectorFrontendHost.openInNewTab(/** @type {string} */ (href)); | 1934 InspectorFrontendHost.openInNewTab(/** @type {string} */ (href)); |
| 1935 }, false); | 1935 }, false); |
| 1936 } else { | 1936 } else { |
| 1937 a.classList.add('devtools-link-prevent-click'); | 1937 a.classList.add('devtools-link-prevent-click'); |
| 1938 } | 1938 } |
| 1939 a[UI._externalLinkSymbol] = true; | 1939 a[UI._externalLinkSymbol] = true; |
| 1940 } | 1940 } |
| 1941 if (linkText !== url) | 1941 if (linkText !== url) |
| 1942 a.title = url; | 1942 a.title = url; |
| 1943 a.textContent = linkText.trimMiddle(150); | 1943 a.textContent = linkText.trimMiddle(UI.MaxLengthForDisplayedURLs); |
| 1944 a.setAttribute('target', '_blank'); | 1944 a.setAttribute('target', '_blank'); |
| 1945 | 1945 |
| 1946 return a; | 1946 return a; |
| 1947 }; | 1947 }; |
| 1948 | 1948 |
| 1949 UI._externalLinkSymbol = Symbol('UI._externalLink'); | 1949 UI._externalLinkSymbol = Symbol('UI._externalLink'); |
| 1950 | 1950 |
| 1951 /** | 1951 /** |
| 1952 * @implements {UI.ContextMenu.Provider} | 1952 * @implements {UI.ContextMenu.Provider} |
| 1953 * @unrestricted | 1953 * @unrestricted |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1988 return new Promise(fulfill => { | 1988 return new Promise(fulfill => { |
| 1989 var image = new Image(); | 1989 var image = new Image(); |
| 1990 image.addEventListener('load', () => fulfill(image)); | 1990 image.addEventListener('load', () => fulfill(image)); |
| 1991 image.addEventListener('error', () => fulfill(null)); | 1991 image.addEventListener('error', () => fulfill(null)); |
| 1992 image.src = url; | 1992 image.src = url; |
| 1993 }); | 1993 }); |
| 1994 }; | 1994 }; |
| 1995 | 1995 |
| 1996 /** @type {!UI.ThemeSupport} */ | 1996 /** @type {!UI.ThemeSupport} */ |
| 1997 UI.themeSupport; | 1997 UI.themeSupport; |
| 1998 | |
| 1999 /** | |
| 2000 * The maximum number of characters to display in a URL. | |
|
dgozman
2017/01/10 01:03:30
Let's remove the comment.
luoe
2017/01/10 22:21:44
Done.
| |
| 2001 * @const | |
| 2002 * @type {number} | |
| 2003 */ | |
| 2004 UI.MaxLengthForDisplayedURLs = 150; | |
| OLD | NEW |