| 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_CHROMEOS_POLICY_SERVER_BACKED_STATE_KEYS_BROKER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_POLICY_SERVER_BACKED_STATE_KEYS_BROKER_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_POLICY_SERVER_BACKED_STATE_KEYS_BROKER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_POLICY_SERVER_BACKED_STATE_KEYS_BROKER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/callback.h" | 12 #include "base/callback.h" |
| 13 #include "base/callback_list.h" | 13 #include "base/callback_list.h" |
| 14 #include "base/macros.h" | 14 #include "base/macros.h" |
| 15 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
| 16 | 16 |
| 17 namespace chromeos { | 17 namespace chromeos { |
| 18 class SessionManagerClient; | 18 class SessionManagerClient; |
| 19 } | 19 } |
| 20 | 20 |
| 21 namespace policy { | 21 namespace policy { |
| 22 | 22 |
| 23 // Brokers server-backed FRE state keys for the device. Retrieves them from | 23 // Brokers server-backed FRE state keys for the device. Retrieves them from |
| 24 // session manager via DBus and refreshes them periodically. Consumers can | 24 // session manager via D-Bus and refreshes them periodically. Consumers can |
| 25 // register callbacks to invoke when the state keys change. | 25 // register callbacks to invoke when the state keys change. |
| 26 class ServerBackedStateKeysBroker { | 26 class ServerBackedStateKeysBroker { |
| 27 public: | 27 public: |
| 28 typedef std::unique_ptr<base::CallbackList<void()>::Subscription> | 28 typedef std::unique_ptr<base::CallbackList<void()>::Subscription> |
| 29 Subscription; | 29 Subscription; |
| 30 typedef base::Callback<void(const std::vector<std::string>&)> | 30 typedef base::Callback<void(const std::vector<std::string>&)> |
| 31 StateKeysCallback; | 31 StateKeysCallback; |
| 32 | 32 |
| 33 ServerBackedStateKeysBroker( | 33 ServerBackedStateKeysBroker( |
| 34 chromeos::SessionManagerClient* session_manager_client); | 34 chromeos::SessionManagerClient* session_manager_client); |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 std::vector<StateKeysCallback> request_callbacks_; | 91 std::vector<StateKeysCallback> request_callbacks_; |
| 92 | 92 |
| 93 base::WeakPtrFactory<ServerBackedStateKeysBroker> weak_factory_; | 93 base::WeakPtrFactory<ServerBackedStateKeysBroker> weak_factory_; |
| 94 | 94 |
| 95 DISALLOW_COPY_AND_ASSIGN(ServerBackedStateKeysBroker); | 95 DISALLOW_COPY_AND_ASSIGN(ServerBackedStateKeysBroker); |
| 96 }; | 96 }; |
| 97 | 97 |
| 98 } // namespace policy | 98 } // namespace policy |
| 99 | 99 |
| 100 #endif // CHROME_BROWSER_CHROMEOS_POLICY_SERVER_BACKED_STATE_KEYS_BROKER_H_ | 100 #endif // CHROME_BROWSER_CHROMEOS_POLICY_SERVER_BACKED_STATE_KEYS_BROKER_H_ |
| OLD | NEW |