| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium OS 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 "src/data_plan_provider.h" | 5 #include "src/data_plan_provider.h" |
| 6 | 6 |
| 7 #include <base/json/json_reader.h> | 7 #include <base/json/json_reader.h> |
| 8 #include <base/scoped_ptr.h> | 8 #include <base/scoped_ptr.h> |
| 9 #include <base/values.h> | 9 #include <base/values.h> |
| 10 #include <glog/logging.h> | 10 #include <glog/logging.h> |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 const std::string& DataPlanProvider::GetCarrier() const { | 27 const std::string& DataPlanProvider::GetCarrier() const { |
| 28 return carrier_; | 28 return carrier_; |
| 29 } | 29 } |
| 30 | 30 |
| 31 const std::string& DataPlanProvider::GetUsageUrl() const { | 31 const std::string& DataPlanProvider::GetUsageUrl() const { |
| 32 return usage_url_; | 32 return usage_url_; |
| 33 } | 33 } |
| 34 | 34 |
| 35 void DataPlanProvider::SetUsageUrl(const std::string& usage_url) { | 35 void DataPlanProvider::SetUsageUrl(const std::string& usage_url) { |
| 36 DLOG(INFO) << carrier_ << ": SetUsageUrl: url = " << usage_url; | 36 DLOG(INFO) << carrier_ << ": SetUsageUrl: url = " << usage_url; |
| 37 if (usage_url_.compare(usage_url)) { | 37 if (usage_url_ != usage_url) { |
| 38 usage_url_ = usage_url; | 38 usage_url_ = usage_url; |
| 39 CancelPendingRequests(); | 39 CancelPendingRequests(); |
| 40 } | 40 } |
| 41 } | 41 } |
| 42 | 42 |
| 43 void DataPlanProvider::SetDelegate(DataPlanProviderDelegate *delegate) { | 43 void DataPlanProvider::SetDelegate(DataPlanProviderDelegate *delegate) { |
| 44 DLOG(INFO) << carrier_ << ": SetDelegate"; | 44 DLOG(INFO) << carrier_ << ": SetDelegate"; |
| 45 delegate_ = delegate; | 45 delegate_ = delegate; |
| 46 if (delegate_ == NULL) { | 46 if (delegate_ == NULL) { |
| 47 CancelPendingRequests(); | 47 CancelPendingRequests(); |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 if (request_in_progress_) { | 138 if (request_in_progress_) { |
| 139 fetcher_->TerminateTransfer(); | 139 fetcher_->TerminateTransfer(); |
| 140 response_buffer_.clear(); | 140 response_buffer_.clear(); |
| 141 request_in_progress_ = false; | 141 request_in_progress_ = false; |
| 142 } | 142 } |
| 143 } | 143 } |
| 144 | 144 |
| 145 // private methods | 145 // private methods |
| 146 | 146 |
| 147 } // namespace cashew | 147 } // namespace cashew |
| OLD | NEW |