| 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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 | 94 |
| 95 std::string CellularConfigDocument::GetErrorMessage(const std::string& code) { | 95 std::string CellularConfigDocument::GetErrorMessage(const std::string& code) { |
| 96 base::AutoLock create(config_lock_); | 96 base::AutoLock create(config_lock_); |
| 97 ErrorMap::iterator iter = error_map_.find(code); | 97 ErrorMap::iterator iter = error_map_.find(code); |
| 98 if (iter == error_map_.end()) | 98 if (iter == error_map_.end()) |
| 99 return code; | 99 return code; |
| 100 return iter->second; | 100 return iter->second; |
| 101 } | 101 } |
| 102 | 102 |
| 103 void CellularConfigDocument::LoadCellularConfigFile() { | 103 void CellularConfigDocument::LoadCellularConfigFile() { |
| 104 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); | 104 DCHECK_CURRENTLY_ON(BrowserThread::FILE); |
| 105 // Load partner customization startup manifest if it is available. | 105 // Load partner customization startup manifest if it is available. |
| 106 base::FilePath config_path(kCellularConfigPath); | 106 base::FilePath config_path(kCellularConfigPath); |
| 107 if (!base::PathExists(config_path)) | 107 if (!base::PathExists(config_path)) |
| 108 return; | 108 return; |
| 109 | 109 |
| 110 if (LoadFromFile(config_path)) | 110 if (LoadFromFile(config_path)) |
| 111 DVLOG(1) << "Cellular config file loaded: " << kCellularConfigPath; | 111 DVLOG(1) << "Cellular config file loaded: " << kCellularConfigPath; |
| 112 else | 112 else |
| 113 LOG(ERROR) << "Error loading cellular config file: " << kCellularConfigPath; | 113 LOG(ERROR) << "Error loading cellular config file: " << kCellularConfigPath; |
| 114 } | 114 } |
| (...skipping 1048 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1163 cellular_plan_payment_time_ = base::Time::Now(); | 1163 cellular_plan_payment_time_ = base::Time::Now(); |
| 1164 } | 1164 } |
| 1165 | 1165 |
| 1166 bool MobileActivator::HasRecentCellularPlanPayment() const { | 1166 bool MobileActivator::HasRecentCellularPlanPayment() const { |
| 1167 const int kRecentPlanPaymentHours = 6; | 1167 const int kRecentPlanPaymentHours = 6; |
| 1168 return (base::Time::Now() - | 1168 return (base::Time::Now() - |
| 1169 cellular_plan_payment_time_).InHours() < kRecentPlanPaymentHours; | 1169 cellular_plan_payment_time_).InHours() < kRecentPlanPaymentHours; |
| 1170 } | 1170 } |
| 1171 | 1171 |
| 1172 } // namespace chromeos | 1172 } // namespace chromeos |
| OLD | NEW |