Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(77)

Unified Diff: blimp/client/core/blimp_client_context_impl.cc

Issue 2261273002: Integrate UI with authentication flow. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Polish wording in the comment. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: blimp/client/core/blimp_client_context_impl.cc
diff --git a/blimp/client/core/blimp_client_context_impl.cc b/blimp/client/core/blimp_client_context_impl.cc
index 4ebebde648c30cfb8a3c03536604343eb4b982d8..2f75beb8aa188223dd3610826ae5f26ab650378f 100644
--- a/blimp/client/core/blimp_client_context_impl.cc
+++ b/blimp/client/core/blimp_client_context_impl.cc
@@ -95,10 +95,7 @@ std::unique_ptr<BlimpContents> BlimpClientContextImpl::CreateBlimpContents() {
void BlimpClientContextImpl::Connect() {
// Lazy initialization of IdentitySource.
David Trainor- moved to gerrit 2016/08/30 20:46:29 Can this just call GetIdentitySource()->Connect()?
xingliu 2016/08/30 22:27:36 Done.
if (!identity_source_) {
- identity_source_ = base::MakeUnique<IdentitySource>(
- delegate_,
- base::Bind(&BlimpClientContextImpl::ConnectToAssignmentSource,
- base::Unretained(this)));
+ CreateIdentitySource();
}
// Start Blimp authentication flow. The OAuth2 token will be used in
@@ -106,6 +103,13 @@ void BlimpClientContextImpl::Connect() {
identity_source_->Connect();
}
+IdentitySource* BlimpClientContextImpl::GetIdentitySource() {
+ if (!identity_source_) {
+ CreateIdentitySource();
+ }
+ return identity_source_.get();
+}
+
void BlimpClientContextImpl::ConnectToAssignmentSource(
const std::string& client_auth_token) {
if (!assignment_source_) {
@@ -165,5 +169,11 @@ void BlimpClientContextImpl::RegisterFeatures() {
tab_control_feature_.get()));
}
+void BlimpClientContextImpl::CreateIdentitySource() {
+ identity_source_ = base::MakeUnique<IdentitySource>(
+ delegate_, base::Bind(&BlimpClientContextImpl::ConnectToAssignmentSource,
+ base::Unretained(this)));
+}
+
} // namespace client
} // namespace blimp

Powered by Google App Engine
This is Rietveld 408576698