Chromium Code Reviews| 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"; |
|
fgorski
2016/04/30 17:42:25
const char kDefaultPolicy[] =
is more common in t
romax
2016/05/02 20:33:44
Done.
|
| +static const int64_t kUnlimitedPage = 0; |
|
fgorski
2016/04/30 17:42:25
pages
romax
2016/05/02 20:33:44
Done.
|
| +static const OfflinePageClientPolicy kDefaultClientPolicy = |
| + {kDefaultPolicy, {LifetimePolicy::LifetimeType::TEMPORARY, |
|
fgorski
2016/04/30 17:42:25
run git cl format
romax
2016/05/02 20:33:44
Done.
|
| + base::TimeDelta::FromDays(1), kUnlimitedPage}}; |
| + |
| +class ClientPolicyController { |
| + public: |
| + static ClientPolicyController& GetInstance(); |
|
fgorski
2016/04/30 17:42:25
Search in components returns a * instead of refere
romax
2016/05/02 20:33:44
Done.
|
| + |
| + OfflinePageClientPolicy GetPolicy(std::string name_space); |
|
fgorski
2016/04/30 17:42:25
const ref name_space and this function is also con
romax
2016/05/02 20:33:44
Done.
|
| + |
| + 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_ |