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/mobile/mobile_activator.h" | 5 #include "chrome/browser/chromeos/mobile/mobile_activator.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 void MobileActivator::HandleSetTransactionStatus(bool success) { | 272 void MobileActivator::HandleSetTransactionStatus(bool success) { |
273 // The payment is received, try to reconnect and check the status all over | 273 // The payment is received, try to reconnect and check the status all over |
274 // again. | 274 // again. |
275 if (success && state_ == PLAN_ACTIVATION_SHOWING_PAYMENT) { | 275 if (success && state_ == PLAN_ACTIVATION_SHOWING_PAYMENT) { |
276 NetworkLibrary* lib = GetNetworkLibrary(); | 276 NetworkLibrary* lib = GetNetworkLibrary(); |
277 lib->SignalCellularPlanPayment(); | 277 lib->SignalCellularPlanPayment(); |
278 UMA_HISTOGRAM_COUNTS("Cellular.PaymentReceived", 1); | 278 UMA_HISTOGRAM_COUNTS("Cellular.PaymentReceived", 1); |
279 CellularNetwork* network = FindMatchingCellularNetwork(true); | 279 CellularNetwork* network = FindMatchingCellularNetwork(true); |
280 if (network && network->activate_over_non_cellular_network()) { | 280 if (network && network->activate_over_non_cellular_network()) { |
281 state_ = PLAN_ACTIVATION_DONE; | 281 state_ = PLAN_ACTIVATION_DONE; |
| 282 // We're done with activation, reset the cellular device. |
| 283 lib->ResetModem(); |
282 EvaluateCellularNetwork(network); | 284 EvaluateCellularNetwork(network); |
283 } else { | 285 } else { |
284 StartOTASP(); | 286 StartOTASP(); |
285 } | 287 } |
286 } else { | 288 } else { |
287 UMA_HISTOGRAM_COUNTS("Cellular.PaymentFailed", 1); | 289 UMA_HISTOGRAM_COUNTS("Cellular.PaymentFailed", 1); |
288 } | 290 } |
289 } | 291 } |
290 | 292 |
291 void MobileActivator::OnPortalLoaded(bool success) { | 293 void MobileActivator::OnPortalLoaded(bool success) { |
(...skipping 660 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
952 | 954 |
953 std::string MobileActivator::GetErrorMessage(const std::string& code) const { | 955 std::string MobileActivator::GetErrorMessage(const std::string& code) const { |
954 return cellular_config_->GetErrorMessage(code); | 956 return cellular_config_->GetErrorMessage(code); |
955 } | 957 } |
956 | 958 |
957 NetworkLibrary* MobileActivator::GetNetworkLibrary() const { | 959 NetworkLibrary* MobileActivator::GetNetworkLibrary() const { |
958 return CrosLibrary::Get()->GetNetworkLibrary(); | 960 return CrosLibrary::Get()->GetNetworkLibrary(); |
959 } | 961 } |
960 | 962 |
961 } // namespace chromeos | 963 } // namespace chromeos |
OLD | NEW |