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 #include "chrome/browser/chromeos/cros/network_library.h" | 5 #include "chrome/browser/chromeos/cros/network_library.h" |
6 | 6 |
7 #include "base/i18n/icu_encoding_detection.h" | 7 #include "base/i18n/icu_encoding_detection.h" |
8 #include "base/i18n/icu_string_conversions.h" | 8 #include "base/i18n/icu_string_conversions.h" |
9 #include "base/i18n/time_formatting.h" | 9 #include "base/i18n/time_formatting.h" |
10 #include "base/json/json_writer.h" // for debug output only. | 10 #include "base/json/json_writer.h" // for debug output only. |
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 } | 369 } |
370 | 370 |
371 void Network::CopyCredentialsFromRemembered(Network* remembered) { | 371 void Network::CopyCredentialsFromRemembered(Network* remembered) { |
372 } | 372 } |
373 | 373 |
374 void Network::SetValueProperty(const char* prop, const base::Value& value) { | 374 void Network::SetValueProperty(const char* prop, const base::Value& value) { |
375 DCHECK(prop); | 375 DCHECK(prop); |
376 if (!EnsureCrosLoaded()) | 376 if (!EnsureCrosLoaded()) |
377 return; | 377 return; |
378 CrosSetNetworkServiceProperty(service_path_, prop, value); | 378 CrosSetNetworkServiceProperty(service_path_, prop, value); |
| 379 // Ensure NetworkStateHandler properties are up-to-date. |
| 380 if (NetworkStateHandler::IsInitialized()) |
| 381 NetworkStateHandler::Get()->RequestUpdateForNetwork(service_path()); |
379 } | 382 } |
380 | 383 |
381 void Network::ClearProperty(const char* prop) { | 384 void Network::ClearProperty(const char* prop) { |
382 DCHECK(prop); | 385 DCHECK(prop); |
383 if (!EnsureCrosLoaded()) | 386 if (!EnsureCrosLoaded()) |
384 return; | 387 return; |
385 CrosClearNetworkServiceProperty(service_path_, prop); | 388 CrosClearNetworkServiceProperty(service_path_, prop); |
| 389 // Ensure NetworkStateHandler properties are up-to-date. |
| 390 if (NetworkStateHandler::IsInitialized()) |
| 391 NetworkStateHandler::Get()->RequestUpdateForNetwork(service_path()); |
386 } | 392 } |
387 | 393 |
388 void Network::SetStringProperty( | 394 void Network::SetStringProperty( |
389 const char* prop, const std::string& str, std::string* dest) { | 395 const char* prop, const std::string& str, std::string* dest) { |
390 if (dest) | 396 if (dest) |
391 *dest = str; | 397 *dest = str; |
392 SetValueProperty(prop, base::StringValue(str)); | 398 SetValueProperty(prop, base::StringValue(str)); |
393 } | 399 } |
394 | 400 |
395 void Network::SetOrClearStringProperty(const char* prop, | 401 void Network::SetOrClearStringProperty(const char* prop, |
(...skipping 978 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1374 NetworkLibrary* impl; | 1380 NetworkLibrary* impl; |
1375 if (stub) | 1381 if (stub) |
1376 impl = new NetworkLibraryImplStub(); | 1382 impl = new NetworkLibraryImplStub(); |
1377 else | 1383 else |
1378 impl = new NetworkLibraryImplCros(); | 1384 impl = new NetworkLibraryImplCros(); |
1379 impl->Init(); | 1385 impl->Init(); |
1380 return impl; | 1386 return impl; |
1381 } | 1387 } |
1382 | 1388 |
1383 } // namespace chromeos | 1389 } // namespace chromeos |
OLD | NEW |