Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(40)

Side by Side Diff: chrome/browser/chromeos/mobile/mobile_activator.cc

Issue 21046008: Convert all connect code to use NetworkHandler instead of NetworkLibrary (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Feedback Round 1 Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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);
pneubeck (no reviews) 2013/08/06 15:45:19 nit: NULL /* no parent window */
stevenjb 2013/08/06 20:23:55 Done.
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698