| 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/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 kDownloadNamespace, LifetimeType::PERSISTENT, | 45 kDownloadNamespace, LifetimeType::PERSISTENT, |
| 46 kUnlimitedPages, kUnlimitedPages) | 46 kUnlimitedPages, kUnlimitedPages) |
| 47 .SetIsRemovedOnCacheReset(false) | 47 .SetIsRemovedOnCacheReset(false) |
| 48 .SetIsSupportedByDownload(true) | 48 .SetIsSupportedByDownload(true) |
| 49 .Build())); | 49 .Build())); |
| 50 policies_.insert(std::make_pair( | 50 policies_.insert(std::make_pair( |
| 51 kNTPSuggestionsNamespace, | 51 kNTPSuggestionsNamespace, |
| 52 OfflinePageClientPolicyBuilder(kNTPSuggestionsNamespace, | 52 OfflinePageClientPolicyBuilder(kNTPSuggestionsNamespace, |
| 53 LifetimeType::PERSISTENT, kUnlimitedPages, | 53 LifetimeType::PERSISTENT, kUnlimitedPages, |
| 54 kUnlimitedPages) | 54 kUnlimitedPages) |
| 55 .SetIsSupportedByDownload(true) |
| 55 .Build())); | 56 .Build())); |
| 56 | 57 |
| 57 // Fallback policy. | 58 // Fallback policy. |
| 58 policies_.insert(std::make_pair( | 59 policies_.insert(std::make_pair( |
| 59 kDefaultNamespace, MakePolicy(kDefaultNamespace, LifetimeType::TEMPORARY, | 60 kDefaultNamespace, MakePolicy(kDefaultNamespace, LifetimeType::TEMPORARY, |
| 60 base::TimeDelta::FromDays(1), 10, 1))); | 61 base::TimeDelta::FromDays(1), 10, 1))); |
| 61 } | 62 } |
| 62 | 63 |
| 63 ClientPolicyController::~ClientPolicyController() {} | 64 ClientPolicyController::~ClientPolicyController() {} |
| 64 | 65 |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 return *show_in_original_tab_cache_; | 154 return *show_in_original_tab_cache_; |
| 154 } | 155 } |
| 155 | 156 |
| 156 void ClientPolicyController::AddPolicyForTest( | 157 void ClientPolicyController::AddPolicyForTest( |
| 157 const std::string& name_space, | 158 const std::string& name_space, |
| 158 const OfflinePageClientPolicyBuilder& builder) { | 159 const OfflinePageClientPolicyBuilder& builder) { |
| 159 policies_.insert(std::make_pair(name_space, builder.Build())); | 160 policies_.insert(std::make_pair(name_space, builder.Build())); |
| 160 } | 161 } |
| 161 | 162 |
| 162 } // namespace offline_pages | 163 } // namespace offline_pages |
| OLD | NEW |