OLD | NEW |
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 runtimeNatives = requireNative('runtime'); | 8 var runtimeNatives = requireNative('runtime'); |
9 var Binding = require('binding').Binding; | 9 var Binding = require('binding').Binding; |
10 var Event = require('event_bindings').Event; | 10 var Event = require('event_bindings').Event; |
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
397 // From the perspective of the API, null is used to reset constraints. | 397 // From the perspective of the API, null is used to reset constraints. |
398 // We need to convert this to 0 because a value of null is interpreted | 398 // We need to convert this to 0 because a value of null is interpreted |
399 // the same as undefined in the browser and leaves the constraint unchanged. | 399 // the same as undefined in the browser and leaves the constraint unchanged. |
400 if (value === null) | 400 if (value === null) |
401 constraints[key] = 0; | 401 constraints[key] = 0; |
402 }); | 402 }); |
403 | 403 |
404 currentWindowInternal.setSizeConstraints(boundsType, constraints); | 404 currentWindowInternal.setSizeConstraints(boundsType, constraints); |
405 } | 405 } |
406 | 406 |
407 exports.binding = appWindow.generate(); | 407 exports.$set('binding', appWindow.generate()); |
408 exports.onAppWindowClosed = onAppWindowClosed; | 408 exports.$set('onAppWindowClosed', onAppWindowClosed); |
409 exports.updateAppWindowProperties = updateAppWindowProperties; | 409 exports.$set('updateAppWindowProperties', updateAppWindowProperties); |
410 exports.appWindowShownForTests = onAppWindowShownForTests; | 410 exports.$set('appWindowShownForTests', onAppWindowShownForTests); |
OLD | NEW |