Alex Vakulenko | 3cb466c | 2014-04-15 11:36:32 -0700 | [diff] [blame] | 1 | // Copyright 2014 The Chromium OS 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 | |
Alex Vakulenko | b3aac25 | 2014-05-07 17:35:24 -0700 | [diff] [blame] | 5 | #ifndef BUFFET_DEVICE_REGISTRATION_INFO_H_ |
| 6 | #define BUFFET_DEVICE_REGISTRATION_INFO_H_ |
Alex Vakulenko | 3cb466c | 2014-04-15 11:36:32 -0700 | [diff] [blame] | 7 | |
Alex Vakulenko | 3cb466c | 2014-04-15 11:36:32 -0700 | [diff] [blame] | 8 | #include <map> |
| 9 | #include <memory> |
Alex Vakulenko | 5841c30 | 2014-07-23 10:49:49 -0700 | [diff] [blame] | 10 | #include <string> |
Alex Vakulenko | b3aac25 | 2014-05-07 17:35:24 -0700 | [diff] [blame] | 11 | #include <utility> |
Alex Vakulenko | 3cb466c | 2014-04-15 11:36:32 -0700 | [diff] [blame] | 12 | |
Anton Muhin | ac661ab | 2014-10-03 20:29:48 +0400 | [diff] [blame] | 13 | #include <base/callback.h> |
Alex Vakulenko | 132617a | 2014-09-04 08:59:43 -0700 | [diff] [blame] | 14 | #include <base/macros.h> |
Christopher Wiley | cd41966 | 2015-02-06 17:51:43 -0800 | [diff] [blame] | 15 | #include <base/memory/weak_ptr.h> |
Nathan Bullock | d9e0bcd | 2015-02-11 11:36:39 -0500 | [diff] [blame] | 16 | #include <base/message_loop/message_loop.h> |
Alex Vakulenko | a3062c5 | 2014-04-21 17:05:51 -0700 | [diff] [blame] | 17 | #include <base/time/time.h> |
Alex Vakulenko | e4879a2 | 2014-08-20 15:47:36 -0700 | [diff] [blame] | 18 | #include <chromeos/data_encoding.h> |
Alex Vakulenko | a8b95bc | 2014-08-27 11:00:57 -0700 | [diff] [blame] | 19 | #include <chromeos/errors/error.h> |
| 20 | #include <chromeos/http/http_transport.h> |
Alex Vakulenko | a3062c5 | 2014-04-21 17:05:51 -0700 | [diff] [blame] | 21 | |
Christopher Wiley | c900e48 | 2015-02-15 15:42:04 -0800 | [diff] [blame] | 22 | #include "buffet/registration_status.h" |
Christopher Wiley | 006e94e | 2014-05-02 13:44:48 -0700 | [diff] [blame] | 23 | #include "buffet/storage_interface.h" |
Nathan Bullock | d9e0bcd | 2015-02-11 11:36:39 -0500 | [diff] [blame] | 24 | #include "buffet/xmpp/xmpp_client.h" |
Alex Vakulenko | 3cb466c | 2014-04-15 11:36:32 -0700 | [diff] [blame] | 25 | |
| 26 | namespace base { |
Vitaly Buka | 6ca3ad6 | 2015-03-11 17:03:23 -0700 | [diff] [blame] | 27 | class DictionaryValue; |
Alex Vakulenko | 3cb466c | 2014-04-15 11:36:32 -0700 | [diff] [blame] | 28 | } // namespace base |
| 29 | |
Anton Muhin | 332df19 | 2014-11-22 05:59:14 +0400 | [diff] [blame] | 30 | namespace chromeos { |
| 31 | class KeyValueStore; |
| 32 | } // namespace chromeos |
| 33 | |
Alex Vakulenko | 3cb466c | 2014-04-15 11:36:32 -0700 | [diff] [blame] | 34 | namespace buffet { |
| 35 | |
Alex Vakulenko | 1f30a62 | 2014-07-23 11:13:15 -0700 | [diff] [blame] | 36 | class CommandManager; |
Alex Vakulenko | 07216fe | 2014-09-19 15:31:09 -0700 | [diff] [blame] | 37 | class StateManager; |
Alex Vakulenko | 1f30a62 | 2014-07-23 11:13:15 -0700 | [diff] [blame] | 38 | |
Alex Vakulenko | b3aac25 | 2014-05-07 17:35:24 -0700 | [diff] [blame] | 39 | extern const char kErrorDomainOAuth2[]; |
| 40 | extern const char kErrorDomainGCD[]; |
| 41 | extern const char kErrorDomainGCDServer[]; |
Alex Vakulenko | b3aac25 | 2014-05-07 17:35:24 -0700 | [diff] [blame] | 42 | |
Alex Vakulenko | 3cb466c | 2014-04-15 11:36:32 -0700 | [diff] [blame] | 43 | // The DeviceRegistrationInfo class represents device registration information. |
Nathan Bullock | d9e0bcd | 2015-02-11 11:36:39 -0500 | [diff] [blame] | 44 | class DeviceRegistrationInfo : public base::MessageLoopForIO::Watcher { |
Alex Vakulenko | 3cb466c | 2014-04-15 11:36:32 -0700 | [diff] [blame] | 45 | public: |
Alex Vakulenko | 8e34d39 | 2014-04-29 11:02:56 -0700 | [diff] [blame] | 46 | // This is a helper class for unit testing. |
| 47 | class TestHelper; |
Christopher Wiley | e0fdeee | 2015-02-07 18:29:32 -0800 | [diff] [blame] | 48 | |
Alex Vakulenko | cca2093 | 2014-08-20 17:35:12 -0700 | [diff] [blame] | 49 | DeviceRegistrationInfo( |
| 50 | const std::shared_ptr<CommandManager>& command_manager, |
Anton Muhin | b831562 | 2014-11-20 03:17:05 +0400 | [diff] [blame] | 51 | const std::shared_ptr<StateManager>& state_manager, |
Anton Muhin | 332df19 | 2014-11-22 05:59:14 +0400 | [diff] [blame] | 52 | std::unique_ptr<chromeos::KeyValueStore> config_store, |
Alex Vakulenko | cca2093 | 2014-08-20 17:35:12 -0700 | [diff] [blame] | 53 | const std::shared_ptr<chromeos::http::Transport>& transport, |
Christopher Wiley | c900e48 | 2015-02-15 15:42:04 -0800 | [diff] [blame] | 54 | const std::shared_ptr<StorageInterface>& state_store, |
Vitaly Buka | 7ad8ffb | 2015-03-20 09:46:57 -0700 | [diff] [blame] | 55 | const base::Closure& on_status_changed); |
Alex Vakulenko | 3cb466c | 2014-04-15 11:36:32 -0700 | [diff] [blame] | 56 | |
Nathan Bullock | d9e0bcd | 2015-02-11 11:36:39 -0500 | [diff] [blame] | 57 | ~DeviceRegistrationInfo() override; |
| 58 | |
Nathan Bullock | f12f7f0 | 2015-02-20 14:46:53 -0500 | [diff] [blame] | 59 | void OnFileCanReadWithoutBlocking(int fd) override; |
Nathan Bullock | d9e0bcd | 2015-02-11 11:36:39 -0500 | [diff] [blame] | 60 | |
| 61 | void OnFileCanWriteWithoutBlocking(int fd) override { |
| 62 | LOG(FATAL) << "No write watcher is configured"; |
| 63 | } |
Anton Muhin | 332df19 | 2014-11-22 05:59:14 +0400 | [diff] [blame] | 64 | |
Christopher Wiley | c900e48 | 2015-02-15 15:42:04 -0800 | [diff] [blame] | 65 | // Returns our current best known registration status. |
| 66 | RegistrationStatus GetRegistrationStatus() const { |
| 67 | return registration_status_; |
| 68 | } |
| 69 | |
Alex Vakulenko | 3cb466c | 2014-04-15 11:36:32 -0700 | [diff] [blame] | 70 | // Returns the authorization HTTP header that can be used to talk |
| 71 | // to GCD server for authenticated device communication. |
Alex Vakulenko | 8e34d39 | 2014-04-29 11:02:56 -0700 | [diff] [blame] | 72 | // Make sure ValidateAndRefreshAccessToken() is called before this call. |
Alex Vakulenko | 3cb466c | 2014-04-15 11:36:32 -0700 | [diff] [blame] | 73 | std::pair<std::string, std::string> GetAuthorizationHeader() const; |
| 74 | |
| 75 | // Returns the GCD service request URL. If |subpath| is specified, it is |
| 76 | // appended to the base URL which is normally |
| 77 | // https://www.googleapis.com/clouddevices/v1/". |
| 78 | // If |params| are specified, each key-value pair is formatted using |
Alex Vakulenko | e4879a2 | 2014-08-20 15:47:36 -0700 | [diff] [blame] | 79 | // chromeos::data_encoding::WebParamsEncode() and appended to URL as a query |
Alex Vakulenko | 3cb466c | 2014-04-15 11:36:32 -0700 | [diff] [blame] | 80 | // string. |
| 81 | // So, calling: |
| 82 | // GetServiceURL("ticket", {{"key","apiKey"}}) |
| 83 | // will return something like: |
| 84 | // https://www.googleapis.com/clouddevices/v1/ticket?key=apiKey |
| 85 | std::string GetServiceURL( |
| 86 | const std::string& subpath = {}, |
Alex Vakulenko | e4879a2 | 2014-08-20 15:47:36 -0700 | [diff] [blame] | 87 | const chromeos::data_encoding::WebParamList& params = {}) const; |
Alex Vakulenko | 3cb466c | 2014-04-15 11:36:32 -0700 | [diff] [blame] | 88 | |
| 89 | // Returns a service URL to access the registered device on GCD server. |
| 90 | // The base URL used to construct the full URL looks like this: |
| 91 | // https://www.googleapis.com/clouddevices/v1/devices/<device_id>/ |
| 92 | std::string GetDeviceURL( |
| 93 | const std::string& subpath = {}, |
Alex Vakulenko | e4879a2 | 2014-08-20 15:47:36 -0700 | [diff] [blame] | 94 | const chromeos::data_encoding::WebParamList& params = {}) const; |
Alex Vakulenko | 3cb466c | 2014-04-15 11:36:32 -0700 | [diff] [blame] | 95 | |
| 96 | // Similar to GetServiceURL, GetOAuthURL() returns a URL of OAuth 2.0 server. |
| 97 | // The base URL used is https://accounts.google.com/o/oauth2/. |
| 98 | std::string GetOAuthURL( |
| 99 | const std::string& subpath = {}, |
Alex Vakulenko | e4879a2 | 2014-08-20 15:47:36 -0700 | [diff] [blame] | 100 | const chromeos::data_encoding::WebParamList& params = {}) const; |
Alex Vakulenko | 3cb466c | 2014-04-15 11:36:32 -0700 | [diff] [blame] | 101 | |
Vitaly Buka | 620bd7e | 2015-03-16 01:07:01 -0700 | [diff] [blame] | 102 | // Returns the registered device ID (GUID) or empty string. |
| 103 | const std::string& GetDeviceId() const; |
Alex Vakulenko | 3cb466c | 2014-04-15 11:36:32 -0700 | [diff] [blame] | 104 | |
| 105 | // Loads the device registration information from cache. |
| 106 | bool Load(); |
| 107 | |
| 108 | // Checks for the valid device registration as well as refreshes |
| 109 | // the device access token, if available. |
Alex Vakulenko | 5f47206 | 2014-08-14 17:54:04 -0700 | [diff] [blame] | 110 | bool CheckRegistration(chromeos::ErrorPtr* error); |
Alex Vakulenko | 3cb466c | 2014-04-15 11:36:32 -0700 | [diff] [blame] | 111 | |
| 112 | // Gets the full device description JSON object, or nullptr if |
| 113 | // the device is not registered or communication failure. |
Vitaly Buka | 6ca3ad6 | 2015-03-11 17:03:23 -0700 | [diff] [blame] | 114 | std::unique_ptr<base::DictionaryValue> GetDeviceInfo( |
| 115 | chromeos::ErrorPtr* error); |
Alex Vakulenko | 3cb466c | 2014-04-15 11:36:32 -0700 | [diff] [blame] | 116 | |
Anton Muhin | beb1c5b | 2014-10-16 18:59:57 +0400 | [diff] [blame] | 117 | // Registers the device. |
| 118 | // |
| 119 | // |params| are a list of key-value pairs of device information, |
| 120 | // such as client_id, client_secret, and so on. If a particular key-value pair |
| 121 | // is omitted, a default value is used when possible. |
| 122 | // Returns a device ID on success. |
Alex Vakulenko | a904434 | 2014-08-23 19:31:27 -0700 | [diff] [blame] | 123 | // The values are all strings for now. |
Anton Muhin | beb1c5b | 2014-10-16 18:59:57 +0400 | [diff] [blame] | 124 | std::string RegisterDevice( |
Alex Vakulenko | a904434 | 2014-08-23 19:31:27 -0700 | [diff] [blame] | 125 | const std::map<std::string, std::string>& params, |
Alex Vakulenko | 5f47206 | 2014-08-14 17:54:04 -0700 | [diff] [blame] | 126 | chromeos::ErrorPtr* error); |
Alex Vakulenko | 3cb466c | 2014-04-15 11:36:32 -0700 | [diff] [blame] | 127 | |
Anton Muhin | 5975552 | 2014-11-05 21:30:12 +0400 | [diff] [blame] | 128 | // Updates a command. |
| 129 | // TODO(antonm): Should solve the issues with async vs. sync. |
| 130 | // TODO(antonm): Consider moving some other class. |
| 131 | void UpdateCommand(const std::string& command_id, |
| 132 | const base::DictionaryValue& command_patch); |
| 133 | |
Alex Vakulenko | 3cb466c | 2014-04-15 11:36:32 -0700 | [diff] [blame] | 134 | private: |
Christopher Wiley | ba983c8 | 2015-03-05 16:32:23 -0800 | [diff] [blame] | 135 | // Cause DeviceRegistrationInfo to attempt to StartDevice on its own later. |
| 136 | void ScheduleStartDevice(const base::TimeDelta& later); |
| 137 | |
| 138 | // Starts device execution. |
| 139 | // Device will do required start up chores and then start to listen |
| 140 | // to new commands. |
| 141 | // TODO(antonm): Consider moving into some other class. |
| 142 | void StartDevice(chromeos::ErrorPtr* error, |
| 143 | const base::TimeDelta& retry_delay); |
| 144 | |
Alex Vakulenko | 3cb466c | 2014-04-15 11:36:32 -0700 | [diff] [blame] | 145 | // Saves the device registration to cache. |
| 146 | bool Save() const; |
| 147 | |
Christopher Wiley | c900e48 | 2015-02-15 15:42:04 -0800 | [diff] [blame] | 148 | // Checks whether we have credentials generated during registration. |
| 149 | bool HaveRegistrationCredentials(chromeos::ErrorPtr* error); |
| 150 | |
David Zeuthen | 390d191 | 2015-03-03 14:54:48 -0500 | [diff] [blame] | 151 | // If we currently have an access token and it doesn't like like it |
| 152 | // has expired yet, returns true immediately. Otherwise calls |
| 153 | // RefreshAccessToken(). |
| 154 | bool MaybeRefreshAccessToken(chromeos::ErrorPtr* error); |
| 155 | |
| 156 | // Forcibly refreshes the access token. |
| 157 | bool RefreshAccessToken(chromeos::ErrorPtr* error); |
Alex Vakulenko | 3cb466c | 2014-04-15 11:36:32 -0700 | [diff] [blame] | 158 | |
Nathan Bullock | 24d189f | 2015-02-26 13:09:18 -0500 | [diff] [blame] | 159 | // Parse the OAuth response, and sets registration status to |
| 160 | // kInvalidCredentials if our registration is no longer valid. |
| 161 | std::unique_ptr<base::DictionaryValue> ParseOAuthResponse( |
| 162 | const chromeos::http::Response* response, chromeos::ErrorPtr* error); |
| 163 | |
Nathan Bullock | bea9113 | 2015-02-19 09:13:33 -0500 | [diff] [blame] | 164 | // This attempts to open the XMPP channel. The XMPP channel needs to be |
| 165 | // restarted anytime the access_token is refreshed. |
| 166 | void StartXmpp(); |
| 167 | |
Anton Muhin | ac661ab | 2014-10-03 20:29:48 +0400 | [diff] [blame] | 168 | using CloudRequestCallback = |
| 169 | base::Callback<void(const base::DictionaryValue&)>; |
Alex Vakulenko | 0357c03 | 2015-01-06 16:32:31 -0800 | [diff] [blame] | 170 | using CloudRequestErrorCallback = |
| 171 | base::Callback<void(const chromeos::Error* error)>; |
Anton Muhin | ac661ab | 2014-10-03 20:29:48 +0400 | [diff] [blame] | 172 | |
| 173 | // Do a HTTPS request to cloud services. |
| 174 | // Handles many cases like reauthorization, 5xx HTTP response codes |
| 175 | // and device removal. It is a recommended way to do cloud API |
| 176 | // requests. |
| 177 | // TODO(antonm): Consider moving into some other class. |
| 178 | void DoCloudRequest( |
Anton Muhin | 233d2ee | 2014-10-22 15:16:24 +0400 | [diff] [blame] | 179 | const std::string& method, |
Anton Muhin | ac661ab | 2014-10-03 20:29:48 +0400 | [diff] [blame] | 180 | const std::string& url, |
| 181 | const base::DictionaryValue* body, |
Alex Vakulenko | 0357c03 | 2015-01-06 16:32:31 -0800 | [diff] [blame] | 182 | const CloudRequestCallback& success_callback, |
| 183 | const CloudRequestErrorCallback& error_callback); |
Anton Muhin | ac661ab | 2014-10-03 20:29:48 +0400 | [diff] [blame] | 184 | |
Christopher Wiley | ba983c8 | 2015-03-05 16:32:23 -0800 | [diff] [blame] | 185 | void UpdateDeviceResource(const base::Closure& on_success, |
| 186 | const CloudRequestErrorCallback& on_failure); |
Anton Muhin | c635c59 | 2014-10-28 21:48:08 +0400 | [diff] [blame] | 187 | |
Christopher Wiley | ba983c8 | 2015-03-05 16:32:23 -0800 | [diff] [blame] | 188 | void FetchCommands( |
| 189 | const base::Callback<void(const base::ListValue&)>& on_success, |
| 190 | const CloudRequestErrorCallback& on_failure); |
Anton Muhin | c635c59 | 2014-10-28 21:48:08 +0400 | [diff] [blame] | 191 | |
Christopher Wiley | ba983c8 | 2015-03-05 16:32:23 -0800 | [diff] [blame] | 192 | void AbortLimboCommands(const base::Closure& callback, |
Anton Muhin | c635c59 | 2014-10-28 21:48:08 +0400 | [diff] [blame] | 193 | const base::ListValue& commands); |
| 194 | |
| 195 | void PeriodicallyPollCommands(); |
| 196 | |
Anton Muhin | d07e206 | 2014-10-27 10:53:29 +0400 | [diff] [blame] | 197 | void PublishCommands(const base::ListValue& commands); |
| 198 | |
Anton Muhin | b831562 | 2014-11-20 03:17:05 +0400 | [diff] [blame] | 199 | void PublishStateUpdates(); |
| 200 | |
David Zeuthen | d0db55c | 2015-02-12 14:47:35 -0500 | [diff] [blame] | 201 | // Looks up the value for parameter with name |param_name| in |
| 202 | // |params|, supplying a default value if one is available and |
| 203 | // |params| doesn't have a value for |param_name|. The value will be |
| 204 | // returned in |param_value|. Returns |true| if a value was set |
| 205 | // (either from |params| or a default), |false| otherwise and |
| 206 | // |error| will be set. |
| 207 | bool GetParamValue( |
Anton Muhin | 332df19 | 2014-11-22 05:59:14 +0400 | [diff] [blame] | 208 | const std::map<std::string, std::string>& params, |
| 209 | const std::string& param_name, |
David Zeuthen | d0db55c | 2015-02-12 14:47:35 -0500 | [diff] [blame] | 210 | std::string* param_value, |
| 211 | chromeos::ErrorPtr* error); |
Anton Muhin | 332df19 | 2014-11-22 05:59:14 +0400 | [diff] [blame] | 212 | |
Anton Muhin | d8d3216 | 2014-10-02 20:37:00 +0400 | [diff] [blame] | 213 | // Builds Cloud API devices collection REST resouce which matches |
| 214 | // current state of the device including command definitions |
| 215 | // for all supported commands and current device state. |
| 216 | std::unique_ptr<base::DictionaryValue> BuildDeviceResource( |
| 217 | chromeos::ErrorPtr* error); |
| 218 | |
Christopher Wiley | c900e48 | 2015-02-15 15:42:04 -0800 | [diff] [blame] | 219 | void SetRegistrationStatus(RegistrationStatus new_status); |
Vitaly Buka | 620bd7e | 2015-03-16 01:07:01 -0700 | [diff] [blame] | 220 | void SetDeviceId(const std::string& device_id); |
Christopher Wiley | c900e48 | 2015-02-15 15:42:04 -0800 | [diff] [blame] | 221 | |
Nathan Bullock | d9e0bcd | 2015-02-11 11:36:39 -0500 | [diff] [blame] | 222 | std::unique_ptr<XmppClient> xmpp_client_; |
| 223 | base::MessageLoopForIO::FileDescriptorWatcher fd_watcher_; |
| 224 | |
Anton Muhin | 332df19 | 2014-11-22 05:59:14 +0400 | [diff] [blame] | 225 | std::string client_id_; |
| 226 | std::string client_secret_; |
| 227 | std::string api_key_; |
Alex Vakulenko | 3cb466c | 2014-04-15 11:36:32 -0700 | [diff] [blame] | 228 | std::string refresh_token_; |
| 229 | std::string device_id_; |
| 230 | std::string device_robot_account_; |
Anton Muhin | 332df19 | 2014-11-22 05:59:14 +0400 | [diff] [blame] | 231 | std::string oauth_url_; |
| 232 | std::string service_url_; |
Anton Muhin | 332df19 | 2014-11-22 05:59:14 +0400 | [diff] [blame] | 233 | std::string device_kind_; |
| 234 | std::string name_; |
| 235 | std::string display_name_; |
| 236 | std::string description_; |
| 237 | std::string location_; |
Vitaly Buka | 6522ab6 | 2015-02-19 10:26:31 -0800 | [diff] [blame] | 238 | std::string model_id_; |
Alex Vakulenko | 3cb466c | 2014-04-15 11:36:32 -0700 | [diff] [blame] | 239 | |
Nathan Bullock | d9e0bcd | 2015-02-11 11:36:39 -0500 | [diff] [blame] | 240 | // Transient data |
| 241 | std::string access_token_; |
| 242 | base::Time access_token_expiration_; |
Nathan Bullock | d9e0bcd | 2015-02-11 11:36:39 -0500 | [diff] [blame] | 243 | |
Alex Vakulenko | a3062c5 | 2014-04-21 17:05:51 -0700 | [diff] [blame] | 244 | // HTTP transport used for communications. |
Alex Vakulenko | cca2093 | 2014-08-20 17:35:12 -0700 | [diff] [blame] | 245 | std::shared_ptr<chromeos::http::Transport> transport_; |
Alex Vakulenko | 8e34d39 | 2014-04-29 11:02:56 -0700 | [diff] [blame] | 246 | // Serialization interface to save and load device registration info. |
| 247 | std::shared_ptr<StorageInterface> storage_; |
Alex Vakulenko | 1f30a62 | 2014-07-23 11:13:15 -0700 | [diff] [blame] | 248 | // Global command manager. |
| 249 | std::shared_ptr<CommandManager> command_manager_; |
Alex Vakulenko | 07216fe | 2014-09-19 15:31:09 -0700 | [diff] [blame] | 250 | // Device state manager. |
Anton Muhin | b831562 | 2014-11-20 03:17:05 +0400 | [diff] [blame] | 251 | std::shared_ptr<StateManager> state_manager_; |
Alex Vakulenko | a3062c5 | 2014-04-21 17:05:51 -0700 | [diff] [blame] | 252 | |
Anton Muhin | 332df19 | 2014-11-22 05:59:14 +0400 | [diff] [blame] | 253 | // Buffet configuration. |
| 254 | std::unique_ptr<chromeos::KeyValueStore> config_store_; |
| 255 | |
Christopher Wiley | c900e48 | 2015-02-15 15:42:04 -0800 | [diff] [blame] | 256 | // Tracks our current registration status. |
Vitaly Buka | b055f15 | 2015-03-12 13:41:43 -0700 | [diff] [blame] | 257 | RegistrationStatus registration_status_{RegistrationStatus::kUnconfigured}; |
Vitaly Buka | 7ad8ffb | 2015-03-20 09:46:57 -0700 | [diff] [blame] | 258 | base::Closure on_status_changed_; |
Christopher Wiley | c900e48 | 2015-02-15 15:42:04 -0800 | [diff] [blame] | 259 | |
Alex Vakulenko | 8e34d39 | 2014-04-29 11:02:56 -0700 | [diff] [blame] | 260 | friend class TestHelper; |
Christopher Wiley | cd41966 | 2015-02-06 17:51:43 -0800 | [diff] [blame] | 261 | base::WeakPtrFactory<DeviceRegistrationInfo> weak_factory_{this}; |
Alex Vakulenko | 3cb466c | 2014-04-15 11:36:32 -0700 | [diff] [blame] | 262 | DISALLOW_COPY_AND_ASSIGN(DeviceRegistrationInfo); |
| 263 | }; |
| 264 | |
| 265 | } // namespace buffet |
| 266 | |
Alex Vakulenko | b3aac25 | 2014-05-07 17:35:24 -0700 | [diff] [blame] | 267 | #endif // BUFFET_DEVICE_REGISTRATION_INFO_H_ |