ios_client_runtime_delegate.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. // Copyright 2017 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. #ifndef REMOTING_IOS_FACADE_IOS_CLIENT_RUNTIME_DELEGATE_H_
  5. #define REMOTING_IOS_FACADE_IOS_CLIENT_RUNTIME_DELEGATE_H_
  6. #include <memory>
  7. #include "base/memory/weak_ptr.h"
  8. #include "remoting/client/chromoting_client_runtime.h"
  9. namespace remoting {
  10. class IosOauthTokenGetter;
  11. class IosClientRuntimeDelegate : public ChromotingClientRuntime::Delegate {
  12. public:
  13. IosClientRuntimeDelegate();
  14. IosClientRuntimeDelegate(const IosClientRuntimeDelegate&) = delete;
  15. IosClientRuntimeDelegate& operator=(const IosClientRuntimeDelegate&) = delete;
  16. ~IosClientRuntimeDelegate() override;
  17. // remoting::ChromotingClientRuntime::Delegate overrides.
  18. void RuntimeWillShutdown() override;
  19. void RuntimeDidShutdown() override;
  20. base::WeakPtr<OAuthTokenGetter> oauth_token_getter() override;
  21. base::WeakPtr<IosClientRuntimeDelegate> GetWeakPtr();
  22. private:
  23. std::unique_ptr<IosOauthTokenGetter> token_getter_;
  24. ChromotingClientRuntime* runtime_;
  25. base::WeakPtrFactory<IosClientRuntimeDelegate> weak_factory_;
  26. };
  27. } // namespace remoting
  28. #endif // REMOTING_IOS_FACADE_IOS_CLIENT_RUNTIME_DELEGATE_H_