| 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
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..6a5439967c5dd4b779e4a43d86c53f3bc53587de
|
| --- /dev/null
|
| +++ b/components/offline_pages/client_policy_controller.h
|
| @@ -0,0 +1,43 @@
|
| +// 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 <string>
|
| +
|
| +#include "base/time/time.h"
|
| +#include "components/offline_pages/offline_page_client_policy.h"
|
| +
|
| +namespace offline_pages {
|
| +
|
| +// Currently used for fallbacks like tests.
|
| +static const char* kDefaultPolicy = "defaultPolicy";
|
| +static const int64_t kUnlimitedPage = 0;
|
| +static const OfflinePageClientPolicy kDefaultClientPolicy =
|
| + {kDefaultPolicy, {LifetimePolicy::LifetimeType::TEMPORARY,
|
| + base::TimeDelta::FromDays(1), kUnlimitedPage}};
|
| +
|
| +class ClientPolicyController {
|
| + public:
|
| + static ClientPolicyController& GetInstance();
|
| +
|
| + OfflinePageClientPolicy GetPolicy(std::string name_space);
|
| +
|
| + protected:
|
| + ClientPolicyController();
|
| +
|
| + ~ClientPolicyController();
|
| +
|
| + std::map<std::string, OfflinePageClientPolicy> policies_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(ClientPolicyController);
|
| +};
|
| +
|
| +} // namespace offline_pages
|
| +
|
| +#endif // COMPONENTS_OFFLINE_PAGES_CLIENT_POLICY_CONTROLLER_H_
|
|
|