OLD | NEW |
---|---|
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #include "blimp/client/core/blimp_client_context_impl.h" | 5 #include "blimp/client/core/blimp_client_context_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/threading/sequenced_task_runner_handle.h" | 10 #include "base/threading/sequenced_task_runner_handle.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
53 // registered. | 53 // registered. |
54 io_thread_task_runner_->PostTask( | 54 io_thread_task_runner_->PostTask( |
55 FROM_HERE, base::Bind(&ClientNetworkComponents::Initialize, | 55 FROM_HERE, base::Bind(&ClientNetworkComponents::Initialize, |
56 base::Unretained(net_components_.get()))); | 56 base::Unretained(net_components_.get()))); |
57 } | 57 } |
58 | 58 |
59 BlimpClientContextImpl::~BlimpClientContextImpl() { | 59 BlimpClientContextImpl::~BlimpClientContextImpl() { |
60 io_thread_task_runner_->DeleteSoon(FROM_HERE, net_components_.release()); | 60 io_thread_task_runner_->DeleteSoon(FROM_HERE, net_components_.release()); |
61 } | 61 } |
62 | 62 |
63 void BlimpClientContextImpl::Connect() { | |
64 if (authenticator_) | |
65 authenticator_->Connect(); | |
nyquist
2016/08/10 01:20:33
If there is no authenticator_ if you have the crea
xingliu
2016/08/10 21:03:15
Done. Now do lazy init and create IdentityProvider
| |
66 } | |
67 | |
63 void BlimpClientContextImpl::SetDelegate(BlimpClientContextDelegate* delegate) { | 68 void BlimpClientContextImpl::SetDelegate(BlimpClientContextDelegate* delegate) { |
64 delegate_ = delegate; | 69 delegate_ = delegate; |
65 } | 70 } |
66 | 71 |
67 std::unique_ptr<BlimpContents> BlimpClientContextImpl::CreateBlimpContents() { | 72 std::unique_ptr<BlimpContents> BlimpClientContextImpl::CreateBlimpContents() { |
68 std::unique_ptr<BlimpContents> blimp_contents = | 73 std::unique_ptr<BlimpContents> blimp_contents = |
69 base::MakeUnique<BlimpContentsImpl>(); | 74 base::MakeUnique<BlimpContentsImpl>(); |
70 delegate_->AttachBlimpContentsHelpers(blimp_contents.get()); | 75 delegate_->AttachBlimpContentsHelpers(blimp_contents.get()); |
71 return blimp_contents; | 76 return blimp_contents; |
72 } | 77 } |
73 | 78 |
79 void BlimpClientContextImpl::CreateAuthenticator( | |
80 std::unique_ptr<IdentityProvider> identity_provider) { | |
81 authenticator_ = base::MakeUnique<Authenticator>( | |
82 std::move(identity_provider)); | |
83 } | |
84 | |
74 void BlimpClientContextImpl::OnConnected() {} | 85 void BlimpClientContextImpl::OnConnected() {} |
75 | 86 |
76 void BlimpClientContextImpl::OnDisconnected(int result) {} | 87 void BlimpClientContextImpl::OnDisconnected(int result) {} |
77 | 88 |
78 } // namespace client | 89 } // namespace client |
79 } // namespace blimp | 90 } // namespace blimp |
OLD | NEW |