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. |
11 #include "base/string_number_conversions.h" | 11 #include "base/string_number_conversions.h" |
12 #include "base/utf_string_conversion_utils.h" | 12 #include "base/utf_string_conversion_utils.h" |
13 #include "base/utf_string_conversions.h" | 13 #include "base/utf_string_conversions.h" |
14 #include "chrome/browser/chromeos/cros/certificate_pattern.h" | 14 #include "chrome/browser/chromeos/cros/certificate_pattern.h" |
15 #include "chrome/browser/chromeos/cros/cros_library.h" | 15 #include "chrome/browser/chromeos/cros/cros_library.h" |
16 #include "chrome/browser/chromeos/cros/native_network_constants.h" | 16 #include "chrome/browser/chromeos/cros/native_network_constants.h" |
17 #include "chrome/browser/chromeos/cros/native_network_parser.h" | 17 #include "chrome/browser/chromeos/cros/native_network_parser.h" |
18 #include "chrome/browser/chromeos/cros/network_library_impl_cros.h" | 18 #include "chrome/browser/chromeos/cros/network_library_impl_cros.h" |
19 #include "chrome/browser/chromeos/cros/network_library_impl_stub.h" | 19 #include "chrome/browser/chromeos/cros/network_library_impl_stub.h" |
20 #include "chrome/common/net/url_util.h" | |
21 #include "chrome/common/net/x509_certificate_model.h" | 20 #include "chrome/common/net/x509_certificate_model.h" |
22 #include "chromeos/network/cros_network_functions.h" | 21 #include "chromeos/network/cros_network_functions.h" |
23 #include "content/public/browser/browser_thread.h" | 22 #include "content/public/browser/browser_thread.h" |
24 #include "grit/generated_resources.h" | 23 #include "grit/generated_resources.h" |
| 24 #include "net/base/url_util.h" |
25 #include "third_party/cros_system_api/dbus/service_constants.h" | 25 #include "third_party/cros_system_api/dbus/service_constants.h" |
26 #include "ui/base/l10n/l10n_util.h" | 26 #include "ui/base/l10n/l10n_util.h" |
27 | 27 |
28 using content::BrowserThread; | 28 using content::BrowserThread; |
29 | 29 |
30 //////////////////////////////////////////////////////////////////////////////// | 30 //////////////////////////////////////////////////////////////////////////////// |
31 // Implementation notes. | 31 // Implementation notes. |
32 // NetworkLibraryImpl manages a series of classes that describe network devices | 32 // NetworkLibraryImpl manages a series of classes that describe network devices |
33 // and services: | 33 // and services: |
34 // | 34 // |
(...skipping 865 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
900 bool CellularNetwork::NeedsActivation() const { | 900 bool CellularNetwork::NeedsActivation() const { |
901 return (activation_state() != ACTIVATION_STATE_ACTIVATED && | 901 return (activation_state() != ACTIVATION_STATE_ACTIVATED && |
902 activation_state() != ACTIVATION_STATE_UNKNOWN); | 902 activation_state() != ACTIVATION_STATE_UNKNOWN); |
903 } | 903 } |
904 | 904 |
905 GURL CellularNetwork::GetAccountInfoUrl() const { | 905 GURL CellularNetwork::GetAccountInfoUrl() const { |
906 if (!post_data_.length()) | 906 if (!post_data_.length()) |
907 return GURL(payment_url()); | 907 return GURL(payment_url()); |
908 | 908 |
909 GURL base_url(kRedirectExtensionPage); | 909 GURL base_url(kRedirectExtensionPage); |
910 GURL temp_url = chrome_common_net::AppendQueryParameter(base_url, | 910 GURL temp_url = net::AppendQueryParameter(base_url, |
911 "post_data", | 911 "post_data", |
912 post_data_); | 912 post_data_); |
913 GURL redir_url = chrome_common_net::AppendQueryParameter(temp_url, | 913 GURL redir_url = net::AppendQueryParameter(temp_url, |
914 "formUrl", | 914 "formUrl", |
915 payment_url()); | 915 payment_url()); |
916 return redir_url; | 916 return redir_url; |
917 } | 917 } |
918 | 918 |
919 std::string CellularNetwork::GetNetworkTechnologyString() const { | 919 std::string CellularNetwork::GetNetworkTechnologyString() const { |
920 // No need to localize these cellular technology abbreviations. | 920 // No need to localize these cellular technology abbreviations. |
921 switch (network_technology_) { | 921 switch (network_technology_) { |
922 case NETWORK_TECHNOLOGY_1XRTT: | 922 case NETWORK_TECHNOLOGY_1XRTT: |
923 return "1xRTT"; | 923 return "1xRTT"; |
924 break; | 924 break; |
925 case NETWORK_TECHNOLOGY_EVDO: | 925 case NETWORK_TECHNOLOGY_EVDO: |
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1378 NetworkLibrary* impl; | 1378 NetworkLibrary* impl; |
1379 if (stub) | 1379 if (stub) |
1380 impl = new NetworkLibraryImplStub(); | 1380 impl = new NetworkLibraryImplStub(); |
1381 else | 1381 else |
1382 impl = new NetworkLibraryImplCros(); | 1382 impl = new NetworkLibraryImplCros(); |
1383 impl->Init(); | 1383 impl->Init(); |
1384 return impl; | 1384 return impl; |
1385 } | 1385 } |
1386 | 1386 |
1387 } // namespace chromeos | 1387 } // namespace chromeos |
OLD | NEW |