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

Unified Diff: remoting/webapp/fullscreen_v2.js

Issue 491873004: Add an explicit full-screen button. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@webapp_move_context_menu
Patch Set: Rebase. Created 6 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
« no previous file with comments | « remoting/webapp/fullscreen_v1.js ('k') | remoting/webapp/html/window_frame.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/fullscreen_v2.js
diff --git a/remoting/webapp/fullscreen_v2.js b/remoting/webapp/fullscreen_v2.js
index 6f6080d1b0830c3317ece143c8e5b8c5e1a6172b..afe2b4fb06f210ed8bf8ec45d0c4f3f59b251c4c 100644
--- a/remoting/webapp/fullscreen_v2.js
+++ b/remoting/webapp/fullscreen_v2.js
@@ -18,12 +18,6 @@ var remoting = remoting || {};
*/
remoting.FullscreenAppsV2 = function() {
/**
- * @type {boolean} True if maximize/restore events are being hooked.
- * @private
- */
- this.hookingWindowEvents_ = false;
-
- /**
* @type {boolean} True if the next onRestored event should cause callbacks
* to be notified of a full-screen changed event. onRestored fires when
* full-screen mode is exited and also when the window is restored from
@@ -47,8 +41,6 @@ remoting.FullscreenAppsV2 = function() {
chrome.app.window.current().onFullscreened.addListener(
this.onFullscreened_.bind(this));
- chrome.app.window.current().onMaximized.addListener(
- this.onMaximized_.bind(this));
chrome.app.window.current().onRestored.addListener(
this.onRestored_.bind(this));
};
@@ -92,39 +84,14 @@ remoting.FullscreenAppsV2.prototype.removeListener = function(callback) {
this.eventSource_.removeEventListener(this.kEventName_, callback);
};
-remoting.FullscreenAppsV2.prototype.syncWithMaximize = function(sync) {
- if (sync && chrome.app.window.current().isMaximized()) {
- chrome.app.window.current().restore();
- this.activate(true);
- }
- this.hookingWindowEvents_ = sync;
-};
-
remoting.FullscreenAppsV2.prototype.onFullscreened_ = function() {
this.notifyCallbacksOnRestore_ = true;
this.eventSource_.raiseEvent(this.kEventName_, true);
document.body.classList.add('fullscreen');
};
-remoting.FullscreenAppsV2.prototype.onMaximized_ = function() {
- if (this.hookingWindowEvents_) {
- chrome.app.window.current().restore();
- this.activate(true);
- }
-};
-
remoting.FullscreenAppsV2.prototype.onRestored_ = function() {
- // TODO(jamiewalch): ChromeOS generates a spurious onRestore event if
- // fullscreen() is called from an onMaximized handler (crbug.com/394819),
- // so ignore the callback if the window is still full-screen.
- if (this.isActive()) {
- return;
- }
-
document.body.classList.remove('fullscreen');
- if (this.hookingWindowEvents_) {
- this.activate(false);
- }
if (this.notifyCallbacksOnRestore_) {
this.notifyCallbacksOnRestore_ = false;
this.eventSource_.raiseEvent(this.kEventName_, false);
« no previous file with comments | « remoting/webapp/fullscreen_v1.js ('k') | remoting/webapp/html/window_frame.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698