Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1400)

Side by Side Diff: components/offline_pages/client_policy_controller.cc

Issue 2224193002: [Offline pages] Add ntp suggestions as a new namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix bad merge Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 21 matching lines...) Expand all
32 kCCTNamespace, 32 kCCTNamespace,
33 MakePolicy(kCCTNamespace, LifetimeType::TEMPORARY, 33 MakePolicy(kCCTNamespace, LifetimeType::TEMPORARY,
34 base::TimeDelta::FromDays(2), kUnlimitedPages, 1))); 34 base::TimeDelta::FromDays(2), kUnlimitedPages, 1)));
35 35
36 policies_.insert(std::make_pair( 36 policies_.insert(std::make_pair(
37 kDownloadNamespace, MakePolicy(kDownloadNamespace, 37 kDownloadNamespace, MakePolicy(kDownloadNamespace,
38 LifetimeType::PERSISTENT, 38 LifetimeType::PERSISTENT,
39 base::TimeDelta::FromDays(0), 39 base::TimeDelta::FromDays(0),
40 kUnlimitedPages, 40 kUnlimitedPages,
41 kUnlimitedPages))); 41 kUnlimitedPages)));
42 policies_.insert(std::make_pair(
43 kNTPSuggestionsNamespace, MakePolicy(kNTPSuggestionsNamespace,
44 LifetimeType::PERSISTENT,
45 base::TimeDelta::FromDays(0),
46 kUnlimitedPages,
47 kUnlimitedPages)));
42 48
43 // Fallback policy. 49 // Fallback policy.
44 policies_.insert(std::make_pair( 50 policies_.insert(std::make_pair(
45 kDefaultNamespace, MakePolicy(kDefaultNamespace, LifetimeType::TEMPORARY, 51 kDefaultNamespace, MakePolicy(kDefaultNamespace, LifetimeType::TEMPORARY,
46 base::TimeDelta::FromDays(1), 10, 1))); 52 base::TimeDelta::FromDays(1), 10, 1)));
47 } 53 }
48 54
49 ClientPolicyController::~ClientPolicyController() {} 55 ClientPolicyController::~ClientPolicyController() {}
50 56
51 // static 57 // static
(...skipping 12 matching lines...) Expand all
64 const OfflinePageClientPolicy& ClientPolicyController::GetPolicy( 70 const OfflinePageClientPolicy& ClientPolicyController::GetPolicy(
65 const std::string& name_space) const { 71 const std::string& name_space) const {
66 const auto& iter = policies_.find(name_space); 72 const auto& iter = policies_.find(name_space);
67 if (iter != policies_.end()) 73 if (iter != policies_.end())
68 return iter->second; 74 return iter->second;
69 // Fallback when the namespace isn't defined. 75 // Fallback when the namespace isn't defined.
70 return policies_.at(kDefaultNamespace); 76 return policies_.at(kDefaultNamespace);
71 } 77 }
72 78
73 } // namespace offline_pages 79 } // namespace offline_pages
OLDNEW
« no previous file with comments | « components/offline_pages/client_namespace_constants.cc ('k') | components/offline_pages/client_policy_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698