| 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 |
| 11 #include "ash/system/chromeos/network/network_connect.h" |
| 11 #include "base/bind.h" | 12 #include "base/bind.h" |
| 12 #include "base/bind_helpers.h" | 13 #include "base/bind_helpers.h" |
| 13 #include "base/file_util.h" | 14 #include "base/file_util.h" |
| 14 #include "base/json/json_reader.h" | 15 #include "base/json/json_reader.h" |
| 15 #include "base/logging.h" | 16 #include "base/logging.h" |
| 16 #include "base/memory/ref_counted_memory.h" | 17 #include "base/memory/ref_counted_memory.h" |
| 17 #include "base/message_loop/message_loop.h" | 18 #include "base/message_loop/message_loop.h" |
| 18 #include "base/metrics/histogram.h" | 19 #include "base/metrics/histogram.h" |
| 19 #include "base/observer_list_threadsafe.h" | 20 #include "base/observer_list_threadsafe.h" |
| 20 #include "base/prefs/pref_service.h" | 21 #include "base/prefs/pref_service.h" |
| (...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 508 GetNetworkLibrary()->DisconnectFromNetwork(network); | 509 GetNetworkLibrary()->DisconnectFromNetwork(network); |
| 509 return; | 510 return; |
| 510 } | 511 } |
| 511 // Stop this callback | 512 // Stop this callback |
| 512 continue_reconnect_timer_.Stop(); | 513 continue_reconnect_timer_.Stop(); |
| 513 EvaluateCellularNetwork(network); | 514 EvaluateCellularNetwork(network); |
| 514 } else { | 515 } else { |
| 515 LOG(WARNING) << "Connect failed, will try again in a little bit."; | 516 LOG(WARNING) << "Connect failed, will try again in a little bit."; |
| 516 if (network) { | 517 if (network) { |
| 517 LOG(INFO) << "Connecting to: " << network->service_path(); | 518 LOG(INFO) << "Connecting to: " << network->service_path(); |
| 518 GetNetworkLibrary()->ConnectToCellularNetwork(network); | 519 ash::network_connect::ConnectToNetwork(network->service_path(), NULL); |
| 519 } | 520 } |
| 520 } | 521 } |
| 521 } | 522 } |
| 522 | 523 |
| 523 void MobileActivator::EvaluateCellularNetwork(CellularNetwork* network) { | 524 void MobileActivator::EvaluateCellularNetwork(CellularNetwork* network) { |
| 524 if (terminated_) { | 525 if (terminated_) { |
| 525 LOG(ERROR) << "Tried to run MobileActivator state machine while " | 526 LOG(ERROR) << "Tried to run MobileActivator state machine while " |
| 526 << "terminated."; | 527 << "terminated."; |
| 527 return; | 528 return; |
| 528 } | 529 } |
| (...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 980 | 981 |
| 981 std::string MobileActivator::GetErrorMessage(const std::string& code) const { | 982 std::string MobileActivator::GetErrorMessage(const std::string& code) const { |
| 982 return cellular_config_->GetErrorMessage(code); | 983 return cellular_config_->GetErrorMessage(code); |
| 983 } | 984 } |
| 984 | 985 |
| 985 NetworkLibrary* MobileActivator::GetNetworkLibrary() const { | 986 NetworkLibrary* MobileActivator::GetNetworkLibrary() const { |
| 986 return NetworkLibrary::Get(); | 987 return NetworkLibrary::Get(); |
| 987 } | 988 } |
| 988 | 989 |
| 989 } // namespace chromeos | 990 } // namespace chromeos |
| OLD | NEW |