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 <dbus/dbus-glib.h> | 7 #include <dbus/dbus-glib.h> |
8 | 8 |
9 #include "base/i18n/icu_encoding_detection.h" | 9 #include "base/i18n/icu_encoding_detection.h" |
10 #include "base/i18n/icu_string_conversions.h" | 10 #include "base/i18n/icu_string_conversions.h" |
11 #include "base/i18n/time_formatting.h" | 11 #include "base/i18n/time_formatting.h" |
12 #include "base/json/json_writer.h" // for debug output only. | 12 #include "base/json/json_writer.h" // for debug output only. |
13 #include "base/string_number_conversions.h" | 13 #include "base/string_number_conversions.h" |
14 #include "base/utf_string_conversion_utils.h" | 14 #include "base/utf_string_conversion_utils.h" |
15 #include "base/utf_string_conversions.h" | 15 #include "base/utf_string_conversions.h" |
16 #include "chrome/browser/chromeos/cros/certificate_pattern.h" | 16 #include "chrome/browser/chromeos/cros/certificate_pattern.h" |
17 #include "chrome/browser/chromeos/cros/cros_library.h" | 17 #include "chrome/browser/chromeos/cros/cros_library.h" |
18 #include "chrome/browser/chromeos/cros/native_network_constants.h" | 18 #include "chrome/browser/chromeos/cros/native_network_constants.h" |
19 #include "chrome/browser/chromeos/cros/native_network_parser.h" | 19 #include "chrome/browser/chromeos/cros/native_network_parser.h" |
20 #include "chrome/browser/chromeos/cros/network_library_impl_cros.h" | 20 #include "chrome/browser/chromeos/cros/network_library_impl_cros.h" |
21 #include "chrome/browser/chromeos/cros/network_library_impl_stub.h" | 21 #include "chrome/browser/chromeos/cros/network_library_impl_stub.h" |
22 #include "chrome/browser/net/browser_url_util.h" | 22 #include "chrome/common/net/url_util.h" |
23 #include "chrome/common/net/x509_certificate_model.h" | 23 #include "chrome/common/net/x509_certificate_model.h" |
24 #include "content/public/browser/browser_thread.h" | 24 #include "content/public/browser/browser_thread.h" |
25 #include "grit/generated_resources.h" | 25 #include "grit/generated_resources.h" |
26 #include "third_party/cros_system_api/dbus/service_constants.h" | 26 #include "third_party/cros_system_api/dbus/service_constants.h" |
27 #include "ui/base/l10n/l10n_util.h" | 27 #include "ui/base/l10n/l10n_util.h" |
28 | 28 |
29 using content::BrowserThread; | 29 using content::BrowserThread; |
30 | 30 |
31 //////////////////////////////////////////////////////////////////////////////// | 31 //////////////////////////////////////////////////////////////////////////////// |
32 // Implementation notes. | 32 // Implementation notes. |
(...skipping 817 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
850 bool CellularNetwork::SupportsDataPlan() const { | 850 bool CellularNetwork::SupportsDataPlan() const { |
851 // TODO(nkostylev): Are there cases when only one of this is defined? | 851 // TODO(nkostylev): Are there cases when only one of this is defined? |
852 return !usage_url().empty() || !payment_url().empty(); | 852 return !usage_url().empty() || !payment_url().empty(); |
853 } | 853 } |
854 | 854 |
855 GURL CellularNetwork::GetAccountInfoUrl() const { | 855 GURL CellularNetwork::GetAccountInfoUrl() const { |
856 if (!post_data_.length()) | 856 if (!post_data_.length()) |
857 return GURL(payment_url()); | 857 return GURL(payment_url()); |
858 | 858 |
859 GURL base_url(kRedirectExtensionPage); | 859 GURL base_url(kRedirectExtensionPage); |
860 GURL temp_url = chrome_browser_net::AppendQueryParameter(base_url, | 860 GURL temp_url = chrome_common_net::AppendQueryParameter(base_url, |
861 "post_data", | 861 "post_data", |
862 post_data_); | 862 post_data_); |
863 GURL redir_url = chrome_browser_net::AppendQueryParameter(temp_url, | 863 GURL redir_url = chrome_common_net::AppendQueryParameter(temp_url, |
864 "formUrl", | 864 "formUrl", |
865 payment_url()); | 865 payment_url()); |
866 return redir_url; | 866 return redir_url; |
867 } | 867 } |
868 | 868 |
869 std::string CellularNetwork::GetNetworkTechnologyString() const { | 869 std::string CellularNetwork::GetNetworkTechnologyString() const { |
870 // No need to localize these cellular technology abbreviations. | 870 // No need to localize these cellular technology abbreviations. |
871 switch (network_technology_) { | 871 switch (network_technology_) { |
872 case NETWORK_TECHNOLOGY_1XRTT: | 872 case NETWORK_TECHNOLOGY_1XRTT: |
873 return "1xRTT"; | 873 return "1xRTT"; |
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1268 NetworkLibrary* impl; | 1268 NetworkLibrary* impl; |
1269 if (stub) | 1269 if (stub) |
1270 impl = new NetworkLibraryImplStub(); | 1270 impl = new NetworkLibraryImplStub(); |
1271 else | 1271 else |
1272 impl = new NetworkLibraryImplCros(); | 1272 impl = new NetworkLibraryImplCros(); |
1273 impl->Init(); | 1273 impl->Init(); |
1274 return impl; | 1274 return impl; |
1275 } | 1275 } |
1276 | 1276 |
1277 } // namespace chromeos | 1277 } // namespace chromeos |
OLD | NEW |