| // Copyright 2015 The Weave Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| #ifndef LIBWEAVE_SRC_BASE_API_HANDLER_H_ |
| #define LIBWEAVE_SRC_BASE_API_HANDLER_H_ |
| #include <base/memory/weak_ptr.h> |
| class DeviceRegistrationInfo; |
| // Handles commands from 'base' package. |
| // Objects of the class subscribe for notification from CommandManager and |
| // execute incoming commands. |
| // base.updateBaseConfiguration |
| class BaseApiHandler final { |
| BaseApiHandler(DeviceRegistrationInfo* device_info, Device* device); |
| void UpdateBaseConfiguration(const std::weak_ptr<Command>& command); |
| void UpdateDeviceInfo(const std::weak_ptr<Command>& command); |
| bool UpdateState(const std::string& anonymous_access_role, |
| void OnConfigChanged(const Settings& settings); |
| DeviceRegistrationInfo* device_info_; |
| base::WeakPtrFactory<BaseApiHandler> weak_ptr_factory_{this}; |
| DISALLOW_COPY_AND_ASSIGN(BaseApiHandler); |
| #endif // LIBWEAVE_SRC_BASE_API_HANDLER_H_ |