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. | 282 network->CompleteActivation(); |
283 lib->ResetModem(); | |
284 EvaluateCellularNetwork(network); | 283 EvaluateCellularNetwork(network); |
285 } else { | 284 } else { |
286 StartOTASP(); | 285 StartOTASP(); |
287 } | 286 } |
288 } else { | 287 } else { |
289 UMA_HISTOGRAM_COUNTS("Cellular.PaymentFailed", 1); | 288 UMA_HISTOGRAM_COUNTS("Cellular.PaymentFailed", 1); |
290 } | 289 } |
291 } | 290 } |
292 | 291 |
293 void MobileActivator::OnPortalLoaded(bool success) { | 292 void MobileActivator::OnPortalLoaded(bool success) { |
(...skipping 660 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
954 | 953 |
955 std::string MobileActivator::GetErrorMessage(const std::string& code) const { | 954 std::string MobileActivator::GetErrorMessage(const std::string& code) const { |
956 return cellular_config_->GetErrorMessage(code); | 955 return cellular_config_->GetErrorMessage(code); |
957 } | 956 } |
958 | 957 |
959 NetworkLibrary* MobileActivator::GetNetworkLibrary() const { | 958 NetworkLibrary* MobileActivator::GetNetworkLibrary() const { |
960 return CrosLibrary::Get()->GetNetworkLibrary(); | 959 return CrosLibrary::Get()->GetNetworkLibrary(); |
961 } | 960 } |
962 | 961 |
963 } // namespace chromeos | 962 } // namespace chromeos |
OLD | NEW |