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 606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
617 network_handler::ErrorCallback()); | 617 network_handler::ErrorCallback()); |
618 return; | 618 return; |
619 } | 619 } |
620 // Stop this callback | 620 // Stop this callback |
621 continue_reconnect_timer_.Stop(); | 621 continue_reconnect_timer_.Stop(); |
622 EvaluateCellularNetwork(network); | 622 EvaluateCellularNetwork(network); |
623 } else { | 623 } else { |
624 LOG(WARNING) << "Connect failed, will try again in a little bit."; | 624 LOG(WARNING) << "Connect failed, will try again in a little bit."; |
625 if (network) { | 625 if (network) { |
626 VLOG(1) << "Connecting to: " << network->path(); | 626 VLOG(1) << "Connecting to: " << network->path(); |
627 ash::network_connect::ConnectToNetwork( | 627 ash::network_connect::ConnectToNetwork(network->path()); |
628 network->path(), NULL /* no parent window */); | |
629 } | 628 } |
630 } | 629 } |
631 } | 630 } |
632 | 631 |
633 void MobileActivator::RefreshCellularNetworks() { | 632 void MobileActivator::RefreshCellularNetworks() { |
634 if (state_ == PLAN_ACTIVATION_PAGE_LOADING || | 633 if (state_ == PLAN_ACTIVATION_PAGE_LOADING || |
635 state_ == PLAN_ACTIVATION_DONE || | 634 state_ == PLAN_ACTIVATION_DONE || |
636 state_ == PLAN_ACTIVATION_ERROR) { | 635 state_ == PLAN_ACTIVATION_ERROR) { |
637 return; | 636 return; |
638 } | 637 } |
(...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1164 cellular_plan_payment_time_ = base::Time::Now(); | 1163 cellular_plan_payment_time_ = base::Time::Now(); |
1165 } | 1164 } |
1166 | 1165 |
1167 bool MobileActivator::HasRecentCellularPlanPayment() const { | 1166 bool MobileActivator::HasRecentCellularPlanPayment() const { |
1168 const int kRecentPlanPaymentHours = 6; | 1167 const int kRecentPlanPaymentHours = 6; |
1169 return (base::Time::Now() - | 1168 return (base::Time::Now() - |
1170 cellular_plan_payment_time_).InHours() < kRecentPlanPaymentHours; | 1169 cellular_plan_payment_time_).InHours() < kRecentPlanPaymentHours; |
1171 } | 1170 } |
1172 | 1171 |
1173 } // namespace chromeos | 1172 } // namespace chromeos |
OLD | NEW |