| 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 var WallpaperUtil = {}; | 5 var WallpaperUtil = {}; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * Saves value to local storage that associates with key. | 8 * Saves value to local storage that associates with key. |
| 9 * @param {string} key The key that associates with value. | 9 * @param {string} key The key that associates with value. |
| 10 * @param {string} value The value to save to local storage. | 10 * @param {string} value The value to save to local storage. |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 chrome.wallpaperPrivate.setWallpaper(xhr.response, layout, url, | 97 chrome.wallpaperPrivate.setWallpaper(xhr.response, layout, url, |
| 98 onSuccess); | 98 onSuccess); |
| 99 self.saveWallpaperInfo(url, layout, | 99 self.saveWallpaperInfo(url, layout, |
| 100 Constants.WallpaperSourceEnum.Online); | 100 Constants.WallpaperSourceEnum.Online); |
| 101 } else { | 101 } else { |
| 102 onFailure(); | 102 onFailure(); |
| 103 } | 103 } |
| 104 }, onFailure); | 104 }, onFailure); |
| 105 }); | 105 }); |
| 106 }; | 106 }; |
| 107 |
| 108 /** |
| 109 * Runs chrome.test.sendMessage in test environment. Does nothing if running |
| 110 * in production environment. |
| 111 * |
| 112 * @param {string} message Test message to send. |
| 113 */ |
| 114 WallpaperUtil.testSendMessage = function(message) { |
| 115 var test = chrome.test || window.top.chrome.test; |
| 116 if (test) |
| 117 test.sendMessage(message); |
| 118 }; |
| OLD | NEW |