OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 /** | 5 /** |
6 * @fileoverview | 6 * @fileoverview |
7 * 'settings-internet-detail' is the settings subpage containing details | 7 * 'settings-internet-detail' is the settings subpage containing details |
8 * for a network. | 8 * for a network. |
9 */ | 9 */ |
10 (function() { | 10 (function() { |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 */ | 151 */ |
152 wasPreviousRouteNetworkDetailPage_: false, | 152 wasPreviousRouteNetworkDetailPage_: false, |
153 | 153 |
154 /** | 154 /** |
155 * settings.RouteObserverBehavior | 155 * settings.RouteObserverBehavior |
156 * @param {!settings.Route} route | 156 * @param {!settings.Route} route |
157 * @param {!settings.Route} oldRoute | 157 * @param {!settings.Route} oldRoute |
158 * @protected | 158 * @protected |
159 */ | 159 */ |
160 currentRouteChanged: function(route, oldRoute) { | 160 currentRouteChanged: function(route, oldRoute) { |
161 if (route != settings.Route.NETWORK_DETAIL) { | 161 if (route != settings.routes.NETWORK_DETAIL) { |
162 if (this.networksChangedListener_) { | 162 if (this.networksChangedListener_) { |
163 this.networkingPrivate.onNetworksChanged.removeListener( | 163 this.networkingPrivate.onNetworksChanged.removeListener( |
164 this.networksChangedListener_); | 164 this.networksChangedListener_); |
165 this.networksChangedListener_ = null; | 165 this.networksChangedListener_ = null; |
166 } | 166 } |
167 return; | 167 return; |
168 } | 168 } |
169 if (!this.networksChangedListener_) { | 169 if (!this.networksChangedListener_) { |
170 this.networksChangedListener_ = this.onNetworksChangedEvent_.bind(this); | 170 this.networksChangedListener_ = this.onNetworksChangedEvent_.bind(this); |
171 this.networkingPrivate.onNetworksChanged.addListener( | 171 this.networkingPrivate.onNetworksChanged.addListener( |
172 this.networksChangedListener_); | 172 this.networksChangedListener_); |
173 } | 173 } |
174 var queryParams = settings.getQueryParameters(); | 174 var queryParams = settings.getQueryParameters(); |
175 this.guid = queryParams.get('guid') || ''; | 175 this.guid = queryParams.get('guid') || ''; |
176 if (!this.guid) { | 176 if (!this.guid) { |
177 console.error('No guid specified for page:' + route); | 177 console.error('No guid specified for page:' + route); |
178 this.close_(); | 178 this.close_(); |
179 } | 179 } |
180 // Set basic networkProperties until they are loaded. | 180 // Set basic networkProperties until they are loaded. |
181 this.networkPropertiesReceived_ = false; | 181 this.networkPropertiesReceived_ = false; |
182 var type = /** @type {!chrome.networkingPrivate.NetworkType} */ ( | 182 var type = /** @type {!chrome.networkingPrivate.NetworkType} */ ( |
183 queryParams.get('type')) || | 183 queryParams.get('type')) || |
184 CrOnc.Type.WI_FI; | 184 CrOnc.Type.WI_FI; |
185 this.shouldShowConfigureWhenNetworkLoaded_ = | 185 this.shouldShowConfigureWhenNetworkLoaded_ = |
186 queryParams.get('showConfigure') == 'true'; | 186 queryParams.get('showConfigure') == 'true'; |
187 this.wasPreviousRouteNetworkDetailPage_ = | 187 this.wasPreviousRouteNetworkDetailPage_ = |
188 oldRoute == settings.Route.NETWORK_DETAIL; | 188 oldRoute == settings.routes.NETWORK_DETAIL; |
189 var name = queryParams.get('name') || type; | 189 var name = queryParams.get('name') || type; |
190 this.networkProperties = { | 190 this.networkProperties = { |
191 GUID: this.guid, | 191 GUID: this.guid, |
192 Type: type, | 192 Type: type, |
193 ConnectionState: CrOnc.ConnectionState.NOT_CONNECTED, | 193 ConnectionState: CrOnc.ConnectionState.NOT_CONNECTED, |
194 Name: {Active: name}, | 194 Name: {Active: name}, |
195 }; | 195 }; |
196 this.didSetFocus_ = false; | 196 this.didSetFocus_ = false; |
197 this.getNetworkDetails_(); | 197 this.getNetworkDetails_(); |
198 }, | 198 }, |
(...skipping 819 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1018 */ | 1018 */ |
1019 allPropertiesMatch_: function(curValue, newValue) { | 1019 allPropertiesMatch_: function(curValue, newValue) { |
1020 for (var key in newValue) { | 1020 for (var key in newValue) { |
1021 if (newValue[key] != curValue[key]) | 1021 if (newValue[key] != curValue[key]) |
1022 return false; | 1022 return false; |
1023 } | 1023 } |
1024 return true; | 1024 return true; |
1025 } | 1025 } |
1026 }); | 1026 }); |
1027 })(); | 1027 })(); |
OLD | NEW |