OLD | NEW |
---|---|
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 /* | 5 /* |
6 * Checks for an extension error that occurred during the asynchronous call. | 6 * Checks for an extension error that occurred during the asynchronous call. |
7 * If an error occurs, will invoke the error callback and throw an exception. | 7 * If an error occurs, will invoke the error callback and throw an exception. |
8 * | 8 * |
9 * @param {function(!Error)} errCallback The callback to invoke for error | 9 * @param {function(!Error)} errCallback The callback to invoke for error |
10 * reporting. | 10 * reporting. |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
64 */ | 64 */ |
65 function updateWindow(updateInfo, callback, errCallback) { | 65 function updateWindow(updateInfo, callback, errCallback) { |
66 chrome.windows.getCurrent({}, function(window) { | 66 chrome.windows.getCurrent({}, function(window) { |
67 checkForExtensionError(errCallback); | 67 checkForExtensionError(errCallback); |
68 chrome.windows.update(window.id, updateInfo, function(window) { | 68 chrome.windows.update(window.id, updateInfo, function(window) { |
69 checkForExtensionError(errCallback); | 69 checkForExtensionError(errCallback); |
70 callback(); | 70 callback(); |
71 }); | 71 }); |
72 }); | 72 }); |
73 } | 73 } |
74 | |
75 /** | |
76 * Launches an app with the specified id. | |
77 * | |
78 * @param {Object} Id The ID of the app to launch | |
chrisgao (Use stgao instead)
2014/01/07 23:36:36
string instead of an Object?
nit: comment ends wit
bustamante
2014/01/13 21:19:29
Done.
| |
79 * @param {function()} callback Invoked when the updating is complete. | |
chrisgao (Use stgao instead)
2014/01/07 23:36:36
It seems the comment is not correct.
bustamante
2014/01/13 21:19:29
Yeah copy/paste error, Done.
| |
80 * @param {function(!Error)} errCallback The callback to invoke for error | |
81 * reporting. | |
82 */ | |
83 function launchApp(Id, callback, errCallback) { | |
84 chrome.management.launchApp(Id, function() { | |
85 checkForExtensionError(errCallback); | |
86 callback(); | |
87 }); | |
88 } | |
OLD | NEW |