Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 #ifndef COMPONENTS_OFFLINE_PAGES_CLIENT_POLICY_CONTROLLER_H_ | 5 #ifndef COMPONENTS_OFFLINE_PAGES_CLIENT_POLICY_CONTROLLER_H_ |
| 6 #define COMPONENTS_OFFLINE_PAGES_CLIENT_POLICY_CONTROLLER_H_ | 6 #define COMPONENTS_OFFLINE_PAGES_CLIENT_POLICY_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 26 static const OfflinePageClientPolicy MakePolicy( | 26 static const OfflinePageClientPolicy MakePolicy( |
| 27 const std::string& name_space, | 27 const std::string& name_space, |
| 28 LifetimePolicy::LifetimeType lifetime_type, | 28 LifetimePolicy::LifetimeType lifetime_type, |
| 29 const base::TimeDelta& expiration_period, | 29 const base::TimeDelta& expiration_period, |
| 30 size_t page_limit, | 30 size_t page_limit, |
| 31 size_t pages_allowed_per_url); | 31 size_t pages_allowed_per_url); |
| 32 | 32 |
| 33 // Get the client policy for |name_space|. | 33 // Get the client policy for |name_space|. |
| 34 const OfflinePageClientPolicy& GetPolicy(const std::string& name_space) const; | 34 const OfflinePageClientPolicy& GetPolicy(const std::string& name_space) const; |
| 35 | 35 |
| 36 // Returns whether the policy for |name_space| is user requested. | |
|
fgorski
2016/09/07 03:25:05
Returns whether offline pages belonging to |name_s
chili
2016/09/12 17:39:00
Done.
| |
| 37 bool IsRemovedOnCacheReset(const std::string& name_space) const; | |
| 38 | |
| 39 // Returns whether the policy for |name_space| is downloaded. | |
|
fgorski
2016/09/07 03:25:05
Returns whether offline pages belonging to |name_s
chili
2016/09/12 17:39:00
Done.
| |
| 40 bool IsSupportedByDownload(const std::string& name_space) const; | |
| 41 | |
| 36 private: | 42 private: |
| 37 // The map from name_space to a client policy. Will be generated | 43 // The map from name_space to a client policy. Will be generated |
| 38 // as pre-defined values for now. | 44 // as pre-defined values for now. |
| 39 std::map<std::string, OfflinePageClientPolicy> policies_; | 45 std::map<std::string, OfflinePageClientPolicy> policies_; |
| 40 | 46 |
| 41 DISALLOW_COPY_AND_ASSIGN(ClientPolicyController); | 47 DISALLOW_COPY_AND_ASSIGN(ClientPolicyController); |
| 42 }; | 48 }; |
| 43 | 49 |
| 44 } // namespace offline_pages | 50 } // namespace offline_pages |
| 45 | 51 |
| 46 #endif // COMPONENTS_OFFLINE_PAGES_CLIENT_POLICY_CONTROLLER_H_ | 52 #endif // COMPONENTS_OFFLINE_PAGES_CLIENT_POLICY_CONTROLLER_H_ |
| OLD | NEW |