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

Unified Diff: chrome/browser/resources/file_manager/js/media/util.js

Issue 10834354: Refactor the Photo Editor to enable new feature work (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years, 4 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
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);
};

Powered by Google App Engine
This is Rietveld 408576698