OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "components/ntp_snippets/ntp_snippets_service.h" | 5 #include "components/ntp_snippets/ntp_snippets_service.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <iterator> | 8 #include <iterator> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 if (!scheduler_) | 273 if (!scheduler_) |
274 return; | 274 return; |
275 | 275 |
276 // If we're NOT_INITED, we don't know whether to schedule or un-schedule. | 276 // If we're NOT_INITED, we don't know whether to schedule or un-schedule. |
277 // We'll reschedule on the next state change anyway, so do nothing here. | 277 // We'll reschedule on the next state change anyway, so do nothing here. |
278 if (state_ == State::NOT_INITED) | 278 if (state_ == State::NOT_INITED) |
279 return; | 279 return; |
280 | 280 |
281 if (ready()) { | 281 if (ready()) { |
282 scheduler_->Schedule(GetFetchingIntervalWifi(), | 282 scheduler_->Schedule(GetFetchingIntervalWifi(), |
283 GetFetchingIntervalFallback(), | 283 GetFetchingIntervalFallback()); |
284 /*reschedule_time=*/base::Time()); | |
285 } else { | 284 } else { |
286 scheduler_->Unschedule(); | 285 scheduler_->Unschedule(); |
287 } | 286 } |
288 } | 287 } |
289 | 288 |
290 CategoryStatus NTPSnippetsService::GetCategoryStatus(Category category) { | 289 CategoryStatus NTPSnippetsService::GetCategoryStatus(Category category) { |
291 DCHECK(categories_.find(category) != categories_.end()); | 290 DCHECK(categories_.find(category) != categories_.end()); |
292 return categories_[category].status; | 291 return categories_[category].status; |
293 } | 292 } |
294 | 293 |
(...skipping 754 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1049 } | 1048 } |
1050 | 1049 |
1051 NTPSnippetsService::CategoryContent::CategoryContent() = default; | 1050 NTPSnippetsService::CategoryContent::CategoryContent() = default; |
1052 NTPSnippetsService::CategoryContent::CategoryContent(CategoryContent&&) = | 1051 NTPSnippetsService::CategoryContent::CategoryContent(CategoryContent&&) = |
1053 default; | 1052 default; |
1054 NTPSnippetsService::CategoryContent::~CategoryContent() = default; | 1053 NTPSnippetsService::CategoryContent::~CategoryContent() = default; |
1055 NTPSnippetsService::CategoryContent& NTPSnippetsService::CategoryContent:: | 1054 NTPSnippetsService::CategoryContent& NTPSnippetsService::CategoryContent:: |
1056 operator=(CategoryContent&&) = default; | 1055 operator=(CategoryContent&&) = default; |
1057 | 1056 |
1058 } // namespace ntp_snippets | 1057 } // namespace ntp_snippets |
OLD | NEW |