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

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

Issue 14663010: Save and restore State for ShellWindows, including panels (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/views/frame/browser_view.cc ('k') | chrome/test/base/test_browser_window.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 Binding = require('binding').Binding; 7 var Binding = require('binding').Binding;
8 var chromeHidden = requireNative('chrome_hidden').GetChromeHidden(); 8 var chromeHidden = requireNative('chrome_hidden').GetChromeHidden();
9 var chrome = requireNative('chrome').GetChrome(); 9 var chrome = requireNative('chrome').GetChrome();
10 var sendRequest = require('sendRequest').sendRequest; 10 var sendRequest = require('sendRequest').sendRequest;
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 }; 115 };
116 116
117 Object.defineProperty(AppWindow.prototype, 'id', {get: function() { 117 Object.defineProperty(AppWindow.prototype, 'id', {get: function() {
118 return chromeHidden.appWindowData.id; 118 return chromeHidden.appWindowData.id;
119 }}); 119 }});
120 120
121 chromeHidden.appWindowData = { 121 chromeHidden.appWindowData = {
122 id: params.id || '', 122 id: params.id || '',
123 bounds: { left: params.bounds.left, top: params.bounds.top, 123 bounds: { left: params.bounds.left, top: params.bounds.top,
124 width: params.bounds.width, height: params.bounds.height }, 124 width: params.bounds.width, height: params.bounds.height },
125 fullscreen: false, 125 fullscreen: params.fullscreen,
126 minimized: false, 126 minimized: params.minimized,
127 maximized: false 127 maximized: params.maximized
128 }; 128 };
129 chromeHidden.currentAppWindow = new AppWindow; 129 chromeHidden.currentAppWindow = new AppWindow;
130 }); 130 });
131 }); 131 });
132 132
133 function boundsEqual(bounds1, bounds2) { 133 function boundsEqual(bounds1, bounds2) {
134 if (!bounds1 || !bounds2) 134 if (!bounds1 || !bounds2)
135 return false; 135 return false;
136 return (bounds1.left == bounds2.left && bounds1.top == bounds2.top && 136 return (bounds1.left == bounds2.left && bounds1.top == bounds2.top &&
137 bounds1.width == bounds2.width && bounds1.height == bounds2.height); 137 bounds1.width == bounds2.width && bounds1.height == bounds2.height);
(...skipping 18 matching lines...) Expand all
156 if (!oldData.maximized && update.maximized) 156 if (!oldData.maximized && update.maximized)
157 currentWindow["onMaximized"].dispatch(); 157 currentWindow["onMaximized"].dispatch();
158 158
159 if ((oldData.fullscreen && !update.fullscreen) || 159 if ((oldData.fullscreen && !update.fullscreen) ||
160 (oldData.minimized && !update.minimized) || 160 (oldData.minimized && !update.minimized) ||
161 (oldData.maximized && !update.maximized)) 161 (oldData.maximized && !update.maximized))
162 currentWindow["onRestored"].dispatch(); 162 currentWindow["onRestored"].dispatch();
163 }; 163 };
164 164
165 exports.binding = appWindow.generate(); 165 exports.binding = appWindow.generate();
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/frame/browser_view.cc ('k') | chrome/test/base/test_browser_window.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698