Index: chrome/browser/resources/google_now/utility.js |
diff --git a/chrome/browser/resources/google_now/utility.js b/chrome/browser/resources/google_now/utility.js |
index 904da6b9cd885dd642262a30d114b1cb604b73e7..efe9c299c9cd1e593619f1d6adef66786641a6de 100644 |
--- a/chrome/browser/resources/google_now/utility.js |
+++ b/chrome/browser/resources/google_now/utility.js |
@@ -436,6 +436,14 @@ wrapper.instrumentChromeApiFunction('identity.onSignInChanged.addListener', 0); |
wrapper.instrumentChromeApiFunction('identity.removeCachedAuthToken', 1); |
wrapper.instrumentChromeApiFunction('webstorePrivate.getBrowserLogin', 0); |
+// Wrap Promise. |
+Promise.prototype.then = function() { |
+ var originalThen = Promise.prototype.then; |
+ return function(callback) { |
+ originalThen.call(this, wrapper.wrapCallback(callback, false)); |
+ } |
+}(); |
+ |
/** |
* Builds the object to manage tasks (mutually exclusive chains of events). |
* @param {function(string, string): boolean} areConflicting Function that |