| 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; |
| 11 var forEach = require('utils').forEach; | 11 var forEach = require('utils').forEach; |
| 12 var renderViewObserverNatives = requireNative('renderViewObserverNatives'); | 12 var renderViewObserverNatives = requireNative('renderViewObserverNatives'); |
| 13 var sendRequest = require('sendRequest').sendRequest; | |
| 14 | 13 |
| 15 var appWindowData = null; | 14 var appWindowData = null; |
| 16 var currentAppWindow = null; | 15 var currentAppWindow = null; |
| 17 | 16 |
| 18 var appWindow = Binding.create('app.window'); | 17 var appWindow = Binding.create('app.window'); |
| 19 appWindow.registerCustomHook(function(bindingsAPI) { | 18 appWindow.registerCustomHook(function(bindingsAPI) { |
| 20 var apiFunctions = bindingsAPI.apiFunctions; | 19 var apiFunctions = bindingsAPI.apiFunctions; |
| 21 | 20 |
| 22 apiFunctions.setCustomCallback('create', | 21 apiFunctions.setCustomCallback('create', |
| 23 function(name, request, windowParams) { | 22 function(name, request, windowParams) { |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 | 208 |
| 210 function onAppWindowClosed() { | 209 function onAppWindowClosed() { |
| 211 if (!currentAppWindow) | 210 if (!currentAppWindow) |
| 212 return; | 211 return; |
| 213 dispatchEventIfExists(currentAppWindow, "onClosed"); | 212 dispatchEventIfExists(currentAppWindow, "onClosed"); |
| 214 } | 213 } |
| 215 | 214 |
| 216 exports.binding = appWindow.generate(); | 215 exports.binding = appWindow.generate(); |
| 217 exports.onAppWindowClosed = onAppWindowClosed; | 216 exports.onAppWindowClosed = onAppWindowClosed; |
| 218 exports.updateAppWindowProperties = updateAppWindowProperties; | 217 exports.updateAppWindowProperties = updateAppWindowProperties; |
| OLD | NEW |