| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/offline_pages/client_policy_controller.h" | 5 #include "components/offline_pages/client_policy_controller.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
| 10 #include "components/offline_pages/client_namespace_constants.h" | 10 #include "components/offline_pages/client_namespace_constants.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 kDownloadNamespace, LifetimeType::PERSISTENT, | 40 kDownloadNamespace, LifetimeType::PERSISTENT, |
| 41 kUnlimitedPages, kUnlimitedPages) | 41 kUnlimitedPages, kUnlimitedPages) |
| 42 .SetIsRemovedOnCacheReset(false) | 42 .SetIsRemovedOnCacheReset(false) |
| 43 .SetIsSupportedByDownload(true) | 43 .SetIsSupportedByDownload(true) |
| 44 .Build())); | 44 .Build())); |
| 45 policies_.insert(std::make_pair( | 45 policies_.insert(std::make_pair( |
| 46 kNTPSuggestionsNamespace, | 46 kNTPSuggestionsNamespace, |
| 47 OfflinePageClientPolicyBuilder(kNTPSuggestionsNamespace, | 47 OfflinePageClientPolicyBuilder(kNTPSuggestionsNamespace, |
| 48 LifetimeType::PERSISTENT, kUnlimitedPages, | 48 LifetimeType::PERSISTENT, kUnlimitedPages, |
| 49 kUnlimitedPages) | 49 kUnlimitedPages) |
| 50 .SetIsSupportedByDownload(true) |
| 50 .Build())); | 51 .Build())); |
| 51 | 52 |
| 52 // Fallback policy. | 53 // Fallback policy. |
| 53 policies_.insert(std::make_pair( | 54 policies_.insert(std::make_pair( |
| 54 kDefaultNamespace, MakePolicy(kDefaultNamespace, LifetimeType::TEMPORARY, | 55 kDefaultNamespace, MakePolicy(kDefaultNamespace, LifetimeType::TEMPORARY, |
| 55 base::TimeDelta::FromDays(1), 10, 1))); | 56 base::TimeDelta::FromDays(1), 10, 1))); |
| 56 } | 57 } |
| 57 | 58 |
| 58 ClientPolicyController::~ClientPolicyController() {} | 59 ClientPolicyController::~ClientPolicyController() {} |
| 59 | 60 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 83 const std::string& name_space) const { | 84 const std::string& name_space) const { |
| 84 return GetPolicy(name_space).feature_policy.is_removed_on_cache_reset; | 85 return GetPolicy(name_space).feature_policy.is_removed_on_cache_reset; |
| 85 } | 86 } |
| 86 | 87 |
| 87 bool ClientPolicyController::IsSupportedByDownload( | 88 bool ClientPolicyController::IsSupportedByDownload( |
| 88 const std::string& name_space) const { | 89 const std::string& name_space) const { |
| 89 return GetPolicy(name_space).feature_policy.is_supported_by_download; | 90 return GetPolicy(name_space).feature_policy.is_supported_by_download; |
| 90 } | 91 } |
| 91 | 92 |
| 92 } // namespace offline_pages | 93 } // namespace offline_pages |
| OLD | NEW |