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

Unified Diff: remoting/webapp/window_frame.js

Issue 418543002: Show the window controls for 3s on entering full-screen mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix bad rebase. Created 6 years, 5 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 | « remoting/webapp/window_frame.css ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/window_frame.js
diff --git a/remoting/webapp/window_frame.js b/remoting/webapp/window_frame.js
index 7c6a75706482f478acd2ea968a32fd20378ee809..6aa32b03e193309aa73136f8378132182db93cbe 100644
--- a/remoting/webapp/window_frame.js
+++ b/remoting/webapp/window_frame.js
@@ -97,6 +97,8 @@ remoting.WindowFrame = function(titleBar) {
this.updateMaximizeOrRestoreIconTitle_.bind(this));
chrome.app.window.current().onFullscreened.addListener(
this.updateMaximizeOrRestoreIconTitle_.bind(this));
+ chrome.app.window.current().onFullscreened.addListener(
+ this.showWindowControlsPreview_.bind(this));
};
/**
@@ -225,6 +227,24 @@ remoting.WindowFrame.prototype.onHideOptionsMenu_ = function() {
this.hoverTarget_.classList.remove('menu-opened');
};
+/**
+ * Show the window controls for a few seconds
+ *
+ * @private
+ */
+remoting.WindowFrame.prototype.showWindowControlsPreview_ = function() {
+ /**
+ * @type {HTMLElement}
+ */
+ var target = this.hoverTarget_;
+ var kPreviewTimeoutMs = 3000;
+ var hidePreview = function() {
+ target.classList.remove('preview');
+ };
+ target.classList.add('preview');
+ window.setTimeout(hidePreview, kPreviewTimeoutMs);
+};
+
/** @type {remoting.WindowFrame} */
-remoting.windowFrame = null;
+remoting.windowFrame = null;
« no previous file with comments | « remoting/webapp/window_frame.css ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698