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

Side by Side Diff: chrome/renderer/resources/extensions/app_window_custom_bindings.js

Issue 26427002: Add always-on-top property to app windows (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cache state of isAlwaysOnTop in widget. Fixed clobber in x11 window init. Created 7 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Custom binding for the app_window API. 5 // Custom binding for the app_window API.
6 6
7 var appWindowNatives = requireNative('app_window_natives'); 7 var appWindowNatives = requireNative('app_window_natives');
8 var Binding = require('binding').Binding; 8 var Binding = require('binding').Binding;
9 var Event = require('event_bindings').Event; 9 var Event = require('event_bindings').Event;
10 var forEach = require('utils').forEach; 10 var forEach = require('utils').forEach;
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 }; 105 };
106 AppWindow.prototype.isFullscreen = function() { 106 AppWindow.prototype.isFullscreen = function() {
107 return appWindowData.fullscreen; 107 return appWindowData.fullscreen;
108 }; 108 };
109 AppWindow.prototype.isMinimized = function() { 109 AppWindow.prototype.isMinimized = function() {
110 return appWindowData.minimized; 110 return appWindowData.minimized;
111 }; 111 };
112 AppWindow.prototype.isMaximized = function() { 112 AppWindow.prototype.isMaximized = function() {
113 return appWindowData.maximized; 113 return appWindowData.maximized;
114 }; 114 };
115 AppWindow.prototype.isAlwaysOnTop = function() {
116 return appWindowData.alwaysOnTop;
117 };
115 118
116 Object.defineProperty(AppWindow.prototype, 'id', {get: function() { 119 Object.defineProperty(AppWindow.prototype, 'id', {get: function() {
117 return appWindowData.id; 120 return appWindowData.id;
118 }}); 121 }});
119 122
120 appWindowData = { 123 appWindowData = {
121 id: params.id || '', 124 id: params.id || '',
122 bounds: { left: params.bounds.left, top: params.bounds.top, 125 bounds: { left: params.bounds.left, top: params.bounds.top,
123 width: params.bounds.width, height: params.bounds.height }, 126 width: params.bounds.width, height: params.bounds.height },
124 fullscreen: params.fullscreen, 127 fullscreen: params.fullscreen,
125 minimized: params.minimized, 128 minimized: params.minimized,
126 maximized: params.maximized 129 maximized: params.maximized,
130 alwaysOnTop: params.alwaysOnTop
127 }; 131 };
128 currentAppWindow = new AppWindow; 132 currentAppWindow = new AppWindow;
129 }); 133 });
130 }); 134 });
131 135
132 function boundsEqual(bounds1, bounds2) { 136 function boundsEqual(bounds1, bounds2) {
133 if (!bounds1 || !bounds2) 137 if (!bounds1 || !bounds2)
134 return false; 138 return false;
135 return (bounds1.left == bounds2.left && bounds1.top == bounds2.top && 139 return (bounds1.left == bounds2.left && bounds1.top == bounds2.top &&
136 bounds1.width == bounds2.width && bounds1.height == bounds2.height); 140 bounds1.width == bounds2.width && bounds1.height == bounds2.height);
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 178
175 function onAppWindowClosed() { 179 function onAppWindowClosed() {
176 if (!currentAppWindow) 180 if (!currentAppWindow)
177 return; 181 return;
178 dispatchEventIfExists(currentAppWindow, "onClosed"); 182 dispatchEventIfExists(currentAppWindow, "onClosed");
179 } 183 }
180 184
181 exports.binding = appWindow.generate(); 185 exports.binding = appWindow.generate();
182 exports.onAppWindowClosed = onAppWindowClosed; 186 exports.onAppWindowClosed = onAppWindowClosed;
183 exports.updateAppWindowProperties = updateAppWindowProperties; 187 exports.updateAppWindowProperties = updateAppWindowProperties;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698