| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 CHROME_BROWSER_COMPONENT_UPDATER_SUPERVISED_USER_WHITELIST_INSTALLER_H_ | 5 #ifndef CHROME_BROWSER_COMPONENT_UPDATER_SUPERVISED_USER_WHITELIST_INSTALLER_H_ |
| 6 #define CHROME_BROWSER_COMPONENT_UPDATER_SUPERVISED_USER_WHITELIST_INSTALLER_H_ | 6 #define CHROME_BROWSER_COMPONENT_UPDATER_SUPERVISED_USER_WHITELIST_INSTALLER_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 // shutdown or a crash). | 57 // shutdown or a crash). |
| 58 virtual void RegisterComponents() = 0; | 58 virtual void RegisterComponents() = 0; |
| 59 | 59 |
| 60 // Subscribes for notifications about available whitelists. Clients should | 60 // Subscribes for notifications about available whitelists. Clients should |
| 61 // filter out the whitelists they are interested in via the |crx_id| | 61 // filter out the whitelists they are interested in via the |crx_id| |
| 62 // parameter. | 62 // parameter. |
| 63 virtual void Subscribe(const WhitelistReadyCallback& callback) = 0; | 63 virtual void Subscribe(const WhitelistReadyCallback& callback) = 0; |
| 64 | 64 |
| 65 // Registers a new whitelist with the given |crx_id|. | 65 // Registers a new whitelist with the given |crx_id|. |
| 66 // The |client_id| should be a unique identifier for the client that is stable | 66 // The |client_id| should be a unique identifier for the client that is stable |
| 67 // across restarts. | 67 // across restarts. If it is empty, the registration will not be persisted in |
| 68 // Local State. |
| 68 virtual void RegisterWhitelist(const std::string& client_id, | 69 virtual void RegisterWhitelist(const std::string& client_id, |
| 69 const std::string& crx_id, | 70 const std::string& crx_id, |
| 70 const std::string& name) = 0; | 71 const std::string& name) = 0; |
| 71 | 72 |
| 72 // Unregisters a whitelist. | 73 // Unregisters a whitelist. |
| 73 virtual void UnregisterWhitelist(const std::string& client_id, | 74 virtual void UnregisterWhitelist(const std::string& client_id, |
| 74 const std::string& crx_id) = 0; | 75 const std::string& crx_id) = 0; |
| 75 | 76 |
| 76 protected: | 77 protected: |
| 77 // Triggers an update for a whitelist to be installed. Protected so it can be | 78 // Triggers an update for a whitelist to be installed. Protected so it can be |
| 78 // called from the implementation subclass, and declared here so that the | 79 // called from the implementation subclass, and declared here so that the |
| 79 // OnDemandUpdater can friend this class and the implementation subclass can | 80 // OnDemandUpdater can friend this class and the implementation subclass can |
| 80 // live in an anonymous namespace. | 81 // live in an anonymous namespace. |
| 81 static void TriggerComponentUpdate(OnDemandUpdater* updater, | 82 static void TriggerComponentUpdate(OnDemandUpdater* updater, |
| 82 const std::string& crx_id); | 83 const std::string& crx_id); |
| 83 }; | 84 }; |
| 84 | 85 |
| 85 } // namespace component_updater | 86 } // namespace component_updater |
| 86 | 87 |
| 87 #endif // CHROME_BROWSER_COMPONENT_UPDATER_SUPERVISED_USER_WHITELIST_INSTALLER_
H_ | 88 #endif // CHROME_BROWSER_COMPONENT_UPDATER_SUPERVISED_USER_WHITELIST_INSTALLER_
H_ |
| OLD | NEW |