ios_client_runtime_delegate.mm 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. #if !defined(__has_feature) || !__has_feature(objc_arc)
  5. #error "This file requires ARC support."
  6. #endif
  7. #include "remoting/ios/facade/ios_client_runtime_delegate.h"
  8. #import "remoting/ios/facade/remoting_authentication.h"
  9. #import "remoting/ios/facade/remoting_service.h"
  10. #include "base/bind.h"
  11. #include "base/check.h"
  12. #include "base/memory/ptr_util.h"
  13. #include "base/memory/weak_ptr.h"
  14. #include "base/strings/sys_string_conversions.h"
  15. #include "remoting/base/oauth_token_getter_proxy.h"
  16. #include "remoting/ios/facade/ios_oauth_token_getter.h"
  17. namespace remoting {
  18. IosClientRuntimeDelegate::IosClientRuntimeDelegate() : weak_factory_(this) {
  19. runtime_ = ChromotingClientRuntime::GetInstance();
  20. token_getter_ = std::make_unique<IosOauthTokenGetter>();
  21. }
  22. IosClientRuntimeDelegate::~IosClientRuntimeDelegate() {}
  23. void IosClientRuntimeDelegate::RuntimeWillShutdown() {
  24. DCHECK(runtime_->ui_task_runner()->BelongsToCurrentThread());
  25. // Nothing to do.
  26. }
  27. void IosClientRuntimeDelegate::RuntimeDidShutdown() {
  28. DCHECK(runtime_->ui_task_runner()->BelongsToCurrentThread());
  29. // Nothing to do.
  30. }
  31. base::WeakPtr<OAuthTokenGetter> IosClientRuntimeDelegate::oauth_token_getter() {
  32. return token_getter_->GetWeakPtr();
  33. }
  34. base::WeakPtr<IosClientRuntimeDelegate> IosClientRuntimeDelegate::GetWeakPtr() {
  35. return weak_factory_.GetWeakPtr();
  36. }
  37. } // namespace remoting