| 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 d91bd680d0274efa82538feb8d2201f7cd37a4d7..3822d7938ae21431c08b104adae27008950ac1c9 100644
|
| --- a/chrome/browser/resources/google_now/utility.js
|
| +++ b/chrome/browser/resources/google_now/utility.js
|
| @@ -648,9 +648,20 @@ function fillFromChromeLocalStorage(
|
| defaultStorageObject,
|
| opt_allowPromiseRejection) {
|
| return new Promise(function(resolve, reject) {
|
| - instrumented.storage.local.get(defaultStorageObject, function(items) {
|
| + // We have to create a keys array because keys with a default value
|
| + // of undefined will cause that key to not be looked up!
|
| + var keysToGet = [];
|
| + for (var key in defaultStorageObject) {
|
| + keysToGet.push(key);
|
| + }
|
| + instrumented.storage.local.get(keysToGet, function(items) {
|
| if (items) {
|
| - resolve(items);
|
| + // Merge the result with the default storage object.
|
| + var result = {};
|
| + for (var key in defaultStorageObject) {
|
| + result[key] = (key in items) ? items[key] : defaultStorageObject[key];
|
| + }
|
| + resolve(result);
|
| } else if (opt_allowPromiseRejection === PromiseRejection.ALLOW) {
|
| reject();
|
| } else {
|
|
|