| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 cr.define('apps_dev_tool', function() { | 5 cr.define('apps_dev_tool', function() { |
| 6 'use strict'; | 6 'use strict'; |
| 7 | 7 |
| 8 // The list of all apps & extensions. | 8 // The list of all apps & extensions. |
| 9 var completeList = []; | 9 var completeList = []; |
| 10 | 10 |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 } | 165 } |
| 166 | 166 |
| 167 // The 'Permissions' link. | 167 // The 'Permissions' link. |
| 168 this.setPermissionsLink_(item, node); | 168 this.setPermissionsLink_(item, node); |
| 169 | 169 |
| 170 // The 'View in Web Store/View Web Site' link. | 170 // The 'View in Web Store/View Web Site' link. |
| 171 if (item.homepage_url) | 171 if (item.homepage_url) |
| 172 this.setWebstoreLink_(item, node); | 172 this.setWebstoreLink_(item, node); |
| 173 | 173 |
| 174 // The 'Reload' checkbox. | 174 // The 'Reload' checkbox. |
| 175 if (item.allow_reload) { | 175 if (item.allow_reload) |
| 176 this.setReloadLink_(item, node); | 176 this.setReloadLink_(item, node); |
| 177 | 177 |
| 178 if (item.type == 'packaged_app') { | 178 if (item.type == 'packaged_app') { |
| 179 // The 'Launch' link. | 179 // The 'Launch' link. |
| 180 var launch = node.querySelector('.launch-link'); | 180 var launch = node.querySelector('.launch-link'); |
| 181 launch.addEventListener('click', function(e) { | 181 launch.addEventListener('click', function(e) { |
| 182 ItemsList.launchApp(item.id); | 182 ItemsList.launchApp(item.id); |
| 183 }); |
| 184 launch.hidden = false; |
| 185 |
| 186 // The 'Restart' link. |
| 187 var restart = node.querySelector('.restart-link'); |
| 188 restart.addEventListener('click', function(e) { |
| 189 chrome.developerPrivate.restart(item.id, function() { |
| 190 ItemsList.loadItemsInfo(); |
| 183 }); | 191 }); |
| 184 launch.hidden = false; | 192 }); |
| 185 | 193 restart.hidden = false; |
| 186 // The 'Restart' link. | |
| 187 var restart = node.querySelector('.restart-link'); | |
| 188 restart.addEventListener('click', function(e) { | |
| 189 chrome.developerPrivate.restart(item.id, function() { | |
| 190 ItemsList.loadItemsInfo(); | |
| 191 }); | |
| 192 }); | |
| 193 restart.hidden = false; | |
| 194 } | |
| 195 } | 194 } |
| 196 | 195 |
| 197 // The terminated reload link. | 196 // The terminated reload link. |
| 198 if (!item.terminated) | 197 if (!item.terminated) |
| 199 this.setEnabledCheckbox_(item, node); | 198 this.setEnabledCheckbox_(item, node); |
| 200 else | 199 else |
| 201 this.setTerminatedReloadLink_(node, item); | 200 this.setTerminatedReloadLink_(node, item); |
| 202 | 201 |
| 203 // Set remove button handler. | 202 // Set remove button handler. |
| 204 this.setRemoveButton_(item, node); | 203 this.setRemoveButton_(item, node); |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 422 ItemsList.launchApp = function(id) { | 421 ItemsList.launchApp = function(id) { |
| 423 chrome.management.launchApp(id, function() { | 422 chrome.management.launchApp(id, function() { |
| 424 ItemsList.loadItemsInfo(); | 423 ItemsList.loadItemsInfo(); |
| 425 }); | 424 }); |
| 426 }; | 425 }; |
| 427 | 426 |
| 428 return { | 427 return { |
| 429 ItemsList: ItemsList, | 428 ItemsList: ItemsList, |
| 430 }; | 429 }; |
| 431 }); | 430 }); |
| OLD | NEW |