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('options', function() { | 5 cr.define('options', function() { |
6 | 6 |
7 var OptionsPage = options.OptionsPage; | 7 var OptionsPage = options.OptionsPage; |
8 var ArrayDataModel = cr.ui.ArrayDataModel; | 8 var ArrayDataModel = cr.ui.ArrayDataModel; |
9 var DeletableItem = options.DeletableItem; | 9 var DeletableItem = options.DeletableItem; |
10 var DeletableItemList = options.DeletableItemList; | 10 var DeletableItemList = options.DeletableItemList; |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 /** @inheritDoc */ | 117 /** @inheritDoc */ |
118 createItem: function(entry) { | 118 createItem: function(entry) { |
119 return new PreferredNetworkListItem(entry); | 119 return new PreferredNetworkListItem(entry); |
120 }, | 120 }, |
121 | 121 |
122 /** @inheritDoc */ | 122 /** @inheritDoc */ |
123 deleteItemAtIndex: function(index) { | 123 deleteItemAtIndex: function(index) { |
124 var item = this.dataModel.item(index); | 124 var item = this.dataModel.item(index); |
125 if (item) { | 125 if (item) { |
126 // Inform the network library that we are forgetting this network. | 126 // Inform the network library that we are forgetting this network. |
127 chrome.send('buttonClickCallback', | 127 chrome.send('networkCommand', |
128 [String(item.networkType), | 128 [String(item.networkType), |
129 item.servicePath, | 129 item.servicePath, |
130 'forget']); | 130 'forget']); |
131 } | 131 } |
132 this.dataModel.splice(index, 1); | 132 this.dataModel.splice(index, 1); |
133 // Invalidate the list since it has a stale cache after a splice | 133 // Invalidate the list since it has a stale cache after a splice |
134 // involving a deletion. | 134 // involving a deletion. |
135 this.invalidate(); | 135 this.invalidate(); |
136 this.redraw(); | 136 this.redraw(); |
137 }, | 137 }, |
(...skipping 18 matching lines...) Expand all Loading... |
156 } | 156 } |
157 }; | 157 }; |
158 | 158 |
159 // Export | 159 // Export |
160 return { | 160 return { |
161 PreferredNetworks: PreferredNetworks | 161 PreferredNetworks: PreferredNetworks |
162 }; | 162 }; |
163 | 163 |
164 }); | 164 }); |
165 | 165 |
OLD | NEW |