Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef COMPONENTS_OFFLINE_PAGES_CLIENT_POLICY_CONTROLLER_H_ | |
| 6 #define COMPONENTS_OFFLINE_PAGES_CLIENT_POLICY_CONTROLLER_H_ | |
| 7 | |
| 8 #include <stdint.h> | |
| 9 | |
| 10 #include <map> | |
| 11 #include <string> | |
| 12 | |
| 13 #include "base/time/time.h" | |
| 14 #include "components/offline_pages/offline_page_client_policy.h" | |
| 15 | |
| 16 namespace offline_pages { | |
| 17 | |
| 18 // Currently used for fallbacks like tests. | |
| 19 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.
| |
| 20 static const int64_t kUnlimitedPage = 0; | |
|
fgorski
2016/04/30 17:42:25
pages
romax
2016/05/02 20:33:44
Done.
| |
| 21 static const OfflinePageClientPolicy kDefaultClientPolicy = | |
| 22 {kDefaultPolicy, {LifetimePolicy::LifetimeType::TEMPORARY, | |
|
fgorski
2016/04/30 17:42:25
run git cl format
romax
2016/05/02 20:33:44
Done.
| |
| 23 base::TimeDelta::FromDays(1), kUnlimitedPage}}; | |
| 24 | |
| 25 class ClientPolicyController { | |
| 26 public: | |
| 27 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.
| |
| 28 | |
| 29 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.
| |
| 30 | |
| 31 protected: | |
| 32 ClientPolicyController(); | |
| 33 | |
| 34 ~ClientPolicyController(); | |
| 35 | |
| 36 std::map<std::string, OfflinePageClientPolicy> policies_; | |
| 37 | |
| 38 DISALLOW_COPY_AND_ASSIGN(ClientPolicyController); | |
| 39 }; | |
| 40 | |
| 41 } // namespace offline_pages | |
| 42 | |
| 43 #endif // COMPONENTS_OFFLINE_PAGES_CLIENT_POLICY_CONTROLLER_H_ | |
| OLD | NEW |