Index: chrome/browser/resources/file_manager/js/media/util.js |
diff --git a/chrome/browser/resources/file_manager/js/media/util.js b/chrome/browser/resources/file_manager/js/media/util.js |
index d55a223bb1cf6b135c64712d0ca650ac9295a0db..9ebc4efed470e3899d5d182d75db6ff3fe5f266e 100644 |
--- a/chrome/browser/resources/file_manager/js/media/util.js |
+++ b/chrome/browser/resources/file_manager/js/media/util.js |
@@ -7,11 +7,14 @@ |
* |
* @param {Element} container The main DOM container. |
* @param {number} opt_timeout Hide timeout in ms. |
+ * @param {function():boolean=} opt_toolsActive Function that returns |true| |
+ * if the tools are active and should not be hidden. |
* @constructor |
*/ |
-function MouseInactivityWatcher(container, opt_timeout) { |
+function MouseInactivityWatcher(container, opt_timeout, opt_toolsActive) { |
this.container_ = container; |
this.timeout_ = opt_timeout || MouseInactivityWatcher.DEFAULT_TIMEOUT; |
+ this.toolsActive_ = opt_toolsActive || function() { return false }; |
this.onTimeoutBound_ = this.onTimeout_.bind(this); |
this.timeoutID_ = null; |
@@ -62,7 +65,7 @@ MouseInactivityWatcher.prototype.startActivity = function() { |
* @param {number} opt_timeout Timeout. |
*/ |
MouseInactivityWatcher.prototype.stopActivity = function(opt_timeout) { |
- if (this.mouseOverTool_) |
+ if (this.mouseOverTool_ || this.toolsActive_()) |
return; |
if (this.timeoutID_) |
@@ -106,5 +109,6 @@ MouseInactivityWatcher.prototype.onMouseMove_ = function(e) { |
*/ |
MouseInactivityWatcher.prototype.onTimeout_ = function() { |
this.timeoutID_ = null; |
- this.showTools(false); |
+ if (!this.toolsActive_()) |
+ this.showTools(false); |
}; |