OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 bindings for the notifications API. | 5 // Custom bindings for the notifications API. |
6 var binding = require('binding').Binding.create('notifications'); | 6 var binding = require('binding').Binding.create('notifications'); |
7 | 7 |
8 var sendRequest = require('sendRequest').sendRequest; | 8 var sendRequest = require('sendRequest').sendRequest; |
9 var imageUtil = require('imageUtil'); | 9 var imageUtil = require('imageUtil'); |
10 var lastError = require('lastError'); | 10 var lastError = require('lastError'); |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
113 failure_function, [callback, id]) | 113 failure_function, [callback, id]) |
114 }); | 114 }); |
115 }; | 115 }; |
116 } | 116 } |
117 | 117 |
118 var handleCreate = genHandle(function(callback, id) { callback(id); }); | 118 var handleCreate = genHandle(function(callback, id) { callback(id); }); |
119 var handleUpdate = genHandle(function(callback, id) { callback(false); }); | 119 var handleUpdate = genHandle(function(callback, id) { callback(false); }); |
120 | 120 |
121 var notificationsCustomHook = function(bindingsAPI, extensionId) { | 121 var notificationsCustomHook = function(bindingsAPI, extensionId) { |
122 var apiFunctions = bindingsAPI.apiFunctions; | 122 var apiFunctions = bindingsAPI.apiFunctions; |
123 apiFunctions.setHandleRequest('create', handleCreate); | 123 apiFunctions.setHandleRequest('create', handleCreate, false); |
124 apiFunctions.setHandleRequest('update', handleCreate); | 124 apiFunctions.setHandleRequest('update', handleCreate, false); |
Matt Perry
2013/03/15 17:51:07
Both of these use sendRequest... sometimes. See ge
| |
125 }; | 125 }; |
126 | 126 |
127 binding.registerCustomHook(notificationsCustomHook); | 127 binding.registerCustomHook(notificationsCustomHook); |
128 | 128 |
129 exports.binding = binding.generate(); | 129 exports.binding = binding.generate(); |
OLD | NEW |