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

Unified Diff: components/offline_pages/client_policy_controller.h

Issue 2489443002: Move all components/offline_pages/ files into component/offline_pages/core (Closed)
Patch Set: more rebase Created 4 years, 1 month 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.h
diff --git a/components/offline_pages/client_policy_controller.h b/components/offline_pages/client_policy_controller.h
deleted file mode 100644
index 8e2d21a4268cf48a22013575a9d3e185f787535e..0000000000000000000000000000000000000000
--- a/components/offline_pages/client_policy_controller.h
+++ /dev/null
@@ -1,77 +0,0 @@
-// Copyright 2016 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef COMPONENTS_OFFLINE_PAGES_CLIENT_POLICY_CONTROLLER_H_
-#define COMPONENTS_OFFLINE_PAGES_CLIENT_POLICY_CONTROLLER_H_
-
-#include <stdint.h>
-
-#include <map>
-#include <memory>
-#include <string>
-#include <vector>
-
-#include "base/time/time.h"
-#include "components/offline_pages/offline_page_client_policy.h"
-
-namespace offline_pages {
-
-// This is the class which is a singleton for offline page model
-// to get client policies based on namespaces.
-class ClientPolicyController {
- public:
- ClientPolicyController();
- ~ClientPolicyController();
-
- // Generates a client policy from the input values.
- static const OfflinePageClientPolicy MakePolicy(
- const std::string& name_space,
- LifetimePolicy::LifetimeType lifetime_type,
- const base::TimeDelta& expiration_period,
- size_t page_limit,
- size_t pages_allowed_per_url);
-
- // Get the client policy for |name_space|.
- const OfflinePageClientPolicy& GetPolicy(const std::string& name_space) const;
-
- // Returns a list of all known namespaces.
- std::vector<std::string> GetAllNamespaces() const;
-
- // Returns whether pages for |name_space| should be removed on cache reset.
- bool IsRemovedOnCacheReset(const std::string& name_space) const;
-
- // Returns whether pages for |name_space| are shown in Download UI.
- bool IsSupportedByDownload(const std::string& name_space) const;
- const std::vector<std::string>& GetNamespacesSupportedByDownload() const;
-
- // Returns whether pages for |name_space| are shown in recent tabs UI,
- // currently only available on NTP.
- bool IsShownAsRecentlyVisitedSite(const std::string& name_space) const;
- const std::vector<std::string>& GetNamespacesShownAsRecentlyVisitedSite()
- const;
-
- // Returns whether pages for |name_space| should never be shown outside the
- // tab they were generated in.
- bool IsRestrictedToOriginalTab(const std::string& name_space) const;
- const std::vector<std::string>& GetNamespacesRestrictedToOriginalTab() const;
-
- void AddPolicyForTest(const std::string& name_space,
- const OfflinePageClientPolicyBuilder& builder);
-
- private:
- // The map from name_space to a client policy. Will be generated
- // as pre-defined values for now.
- std::map<std::string, OfflinePageClientPolicy> policies_;
-
- // Memoizing results.
- mutable std::unique_ptr<std::vector<std::string>> download_namespace_cache_;
- mutable std::unique_ptr<std::vector<std::string>> recent_tab_namespace_cache_;
- mutable std::unique_ptr<std::vector<std::string>> show_in_original_tab_cache_;
-
- DISALLOW_COPY_AND_ASSIGN(ClientPolicyController);
-};
-
-} // namespace offline_pages
-
-#endif // COMPONENTS_OFFLINE_PAGES_CLIENT_POLICY_CONTROLLER_H_

Powered by Google App Engine
This is Rietveld 408576698