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

Unified Diff: Source/devtools/front_end/ui/UIUtils.js

Issue 344443003: DevTools: Code fixes for the Closure compiler roll (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Address comments Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/devtools/front_end/ui/ShortcutRegistry.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/ui/UIUtils.js
diff --git a/Source/devtools/front_end/ui/UIUtils.js b/Source/devtools/front_end/ui/UIUtils.js
index 80c89a9923fc735c80e03fafff8738c19e7eaaed..a2d7f8feaddeea5cd878e9887cc3aec14ff8f348 100644
--- a/Source/devtools/front_end/ui/UIUtils.js
+++ b/Source/devtools/front_end/ui/UIUtils.js
@@ -34,7 +34,7 @@
* @param {?function(!MouseEvent): boolean} elementDragStart
* @param {function(!MouseEvent)} elementDrag
* @param {?function(!MouseEvent)} elementDragEnd
- * @param {!string} cursor
+ * @param {string} cursor
* @param {?string=} hoverCursor
*/
WebInspector.installDragHandle = function(element, elementDragStart, elementDrag, elementDragEnd, cursor, hoverCursor)
@@ -167,9 +167,13 @@ WebInspector.GlassPane.prototype = {
*/
WebInspector.GlassPane.DefaultFocusedViewStack = [];
+/**
+ * @param {?Node=} node
+ * @return {boolean}
+ */
WebInspector.isBeingEdited = function(node)
{
- if (node.nodeType !== Node.ELEMENT_NODE)
+ if (!node || node.nodeType !== Node.ELEMENT_NODE)
return false;
var element = /** {!Element} */ (node);
if (element.classList.contains("text-prompt") || element.nodeName === "INPUT" || element.nodeName === "TEXTAREA")
@@ -186,6 +190,11 @@ WebInspector.isBeingEdited = function(node)
return false;
}
+/**
+ * @param {!Element} element
+ * @param {boolean} value
+ * @return {boolean}
+ */
WebInspector.markBeingEdited = function(element, value)
{
if (value) {
@@ -469,6 +478,10 @@ Number.bytesToString = function(bytes)
return WebInspector.UIString("%.0f\u2009MB", megabytes);
}
+/**
+ * @param {number} num
+ * @return {string}
+ */
Number.withThousandsSeparator = function(num)
{
var str = num + "";
@@ -478,21 +491,38 @@ Number.withThousandsSeparator = function(num)
return str;
}
+/**
+ * @return {boolean}
+ */
WebInspector.useLowerCaseMenuTitles = function()
{
return WebInspector.platform() === "windows";
}
+/**
+ * @param {string} format
+ * @param {?Array.<string>} substitutions
+ * @param {!Object.<string, function(string, ...):*>} formatters
+ * @param {string} initialValue
+ * @param {function(string, string): ?} append
+ * @return {!{formattedResult: string, unusedSubstitutions: ?Array.<string>}};
+ */
WebInspector.formatLocalized = function(format, substitutions, formatters, initialValue, append)
{
return String.format(WebInspector.UIString(format), substitutions, formatters, initialValue, append);
}
+/**
+ * @return {string}
+ */
WebInspector.openLinkExternallyLabel = function()
{
return WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Open link in new tab" : "Open Link in New Tab");
}
+/**
+ * @return {string}
+ */
WebInspector.copyLinkAddressLabel = function()
{
return WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Copy link address" : "Copy Link Address");
@@ -521,11 +551,17 @@ WebInspector._windowBlurred = function(event)
document.body.classList.add("inactive");
}
+/**
+ * @return {!Element}
+ */
WebInspector.previousFocusElement = function()
{
return WebInspector._previousFocusElement;
}
+/**
+ * @return {!Element}
+ */
WebInspector.currentFocusElement = function()
{
return WebInspector._currentFocusElement;
@@ -627,6 +663,7 @@ WebInspector.resetToolbarColors = function()
* @param {number} offset
* @param {number} length
* @param {!Array.<!Object>=} domChanges
+ * @return {?Element}
*/
WebInspector.highlightSearchResult = function(element, offset, length, domChanges)
{
@@ -638,6 +675,7 @@ WebInspector.highlightSearchResult = function(element, offset, length, domChange
* @param {!Element} element
* @param {!Array.<!WebInspector.SourceRange>} resultRanges
* @param {!Array.<!Object>=} changes
+ * @return {!Array.<!Element>}
*/
WebInspector.highlightSearchResults = function(element, resultRanges, changes)
{
« no previous file with comments | « Source/devtools/front_end/ui/ShortcutRegistry.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698