| 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( |
| 520 network->service_path(), NULL /* no parent window */); |
| 519 } | 521 } |
| 520 } | 522 } |
| 521 } | 523 } |
| 522 | 524 |
| 523 void MobileActivator::EvaluateCellularNetwork(CellularNetwork* network) { | 525 void MobileActivator::EvaluateCellularNetwork(CellularNetwork* network) { |
| 524 if (terminated_) { | 526 if (terminated_) { |
| 525 LOG(ERROR) << "Tried to run MobileActivator state machine while " | 527 LOG(ERROR) << "Tried to run MobileActivator state machine while " |
| 526 << "terminated."; | 528 << "terminated."; |
| 527 return; | 529 return; |
| 528 } | 530 } |
| (...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 980 | 982 |
| 981 std::string MobileActivator::GetErrorMessage(const std::string& code) const { | 983 std::string MobileActivator::GetErrorMessage(const std::string& code) const { |
| 982 return cellular_config_->GetErrorMessage(code); | 984 return cellular_config_->GetErrorMessage(code); |
| 983 } | 985 } |
| 984 | 986 |
| 985 NetworkLibrary* MobileActivator::GetNetworkLibrary() const { | 987 NetworkLibrary* MobileActivator::GetNetworkLibrary() const { |
| 986 return NetworkLibrary::Get(); | 988 return NetworkLibrary::Get(); |
| 987 } | 989 } |
| 988 | 990 |
| 989 } // namespace chromeos | 991 } // namespace chromeos |
| OLD | NEW |