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 #include <dbus/dbus-gtype-specialized.h> | 8 #include <dbus/dbus-gtype-specialized.h> |
9 #include <glib-object.h> | 9 #include <glib-object.h> |
10 | 10 |
(...skipping 1241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1252 SetValueProperty(flimflam::kCellularApnProperty, &value); | 1252 SetValueProperty(flimflam::kCellularApnProperty, &value); |
1253 } else { | 1253 } else { |
1254 ClearProperty(flimflam::kCellularApnProperty); | 1254 ClearProperty(flimflam::kCellularApnProperty); |
1255 } | 1255 } |
1256 } | 1256 } |
1257 | 1257 |
1258 bool CellularNetwork::SupportsActivation() const { | 1258 bool CellularNetwork::SupportsActivation() const { |
1259 return SupportsDataPlan(); | 1259 return SupportsDataPlan(); |
1260 } | 1260 } |
1261 | 1261 |
| 1262 bool CellularNetwork::NeedsActivation() const { |
| 1263 return (activation_state() != ACTIVATION_STATE_ACTIVATED && |
| 1264 activation_state() != ACTIVATION_STATE_UNKNOWN) || |
| 1265 needs_new_plan(); |
| 1266 } |
| 1267 |
1262 bool CellularNetwork::SupportsDataPlan() const { | 1268 bool CellularNetwork::SupportsDataPlan() const { |
1263 // TODO(nkostylev): Are there cases when only one of this is defined? | 1269 // TODO(nkostylev): Are there cases when only one of this is defined? |
1264 return !usage_url().empty() || !payment_url().empty(); | 1270 return !usage_url().empty() || !payment_url().empty(); |
1265 } | 1271 } |
1266 | 1272 |
1267 GURL CellularNetwork::GetAccountInfoUrl() const { | 1273 GURL CellularNetwork::GetAccountInfoUrl() const { |
1268 if (!post_data_.length()) | 1274 if (!post_data_.length()) |
1269 return GURL(payment_url()); | 1275 return GURL(payment_url()); |
1270 | 1276 |
1271 GURL base_url(kRedirectExtensionPage); | 1277 GURL base_url(kRedirectExtensionPage); |
(...skipping 4466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5738 impl = new NetworkLibraryImplStub(); | 5744 impl = new NetworkLibraryImplStub(); |
5739 else | 5745 else |
5740 impl = new NetworkLibraryImplCros(); | 5746 impl = new NetworkLibraryImplCros(); |
5741 impl->Init(); | 5747 impl->Init(); |
5742 return impl; | 5748 return impl; |
5743 } | 5749 } |
5744 | 5750 |
5745 ///////////////////////////////////////////////////////////////////////////// | 5751 ///////////////////////////////////////////////////////////////////////////// |
5746 | 5752 |
5747 } // namespace chromeos | 5753 } // namespace chromeos |
OLD | NEW |