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

Unified Diff: components/offline_pages/client_policy_controller.cc

Issue 2415473003: Query API: Introduces an OfflinePageModelQuery object. (Closed)
Patch Set: Address more comments. Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: components/offline_pages/client_policy_controller.cc
diff --git a/components/offline_pages/client_policy_controller.cc b/components/offline_pages/client_policy_controller.cc
index 23772308ec9f5490ddc75e9ed79469a727f75a0c..0a2d288101c4aa13ab514bf4ffc7b90ddd5ece17 100644
--- a/components/offline_pages/client_policy_controller.cc
+++ b/components/offline_pages/client_policy_controller.cc
@@ -84,6 +84,14 @@ const OfflinePageClientPolicy& ClientPolicyController::GetPolicy(
return policies_.at(kDefaultNamespace);
}
+std::vector<std::string> ClientPolicyController::GetAllNamespaces() const {
+ std::vector<std::string> result;
+ for (const auto& policy_item : policies_)
+ result.emplace_back(policy_item.first);
+
+ return result;
+}
+
bool ClientPolicyController::IsRemovedOnCacheReset(
const std::string& name_space) const {
return GetPolicy(name_space).feature_policy.is_removed_on_cache_reset;
@@ -145,4 +153,10 @@ ClientPolicyController::GetNamespacesRestrictedToOriginalTab() const {
return *show_in_original_tab_cache_;
}
+void ClientPolicyController::AddPolicyForTest(
+ const std::string& name_space,
+ const OfflinePageClientPolicyBuilder& builder) {
+ policies_.insert(std::make_pair(name_space, builder.Build()));
+}
+
} // namespace offline_pages
« no previous file with comments | « components/offline_pages/client_policy_controller.h ('k') | components/offline_pages/offline_page_model_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698