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

Unified Diff: blimp/client/app/linux/blimp_client_context_delegate_linux.cc

Issue 2363153002: Migrate Linux Blimp client to use BlimpClientContext (Closed)
Patch Set: Fix more nits Created 4 years, 3 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/app/linux/blimp_client_context_delegate_linux.cc
diff --git a/blimp/client/app/linux/blimp_client_context_delegate_linux.cc b/blimp/client/app/linux/blimp_client_context_delegate_linux.cc
new file mode 100644
index 0000000000000000000000000000000000000000..194877b85e5f22cd8807596b2deead97692f82aa
--- /dev/null
+++ b/blimp/client/app/linux/blimp_client_context_delegate_linux.cc
@@ -0,0 +1,53 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/memory/ptr_util.h"
+#include "blimp/client/app/linux/blimp_client_context_delegate_linux.h"
+#include "blimp/client/support/session/blimp_default_identity_provider.h"
+
+namespace blimp {
+namespace client {
+
+BlimpClientContextDelegateLinux::BlimpClientContextDelegateLinux() = default;
+
+BlimpClientContextDelegateLinux::~BlimpClientContextDelegateLinux() = default;
+
+void BlimpClientContextDelegateLinux::AttachBlimpContentsHelpers(
+ BlimpContents* blimp_contents) {}
+
+void BlimpClientContextDelegateLinux::OnAssignmentConnectionAttempted(
+ AssignmentRequestResult result,
+ const Assignment& assignment) {
+ switch (result) {
+ case AssignmentRequestResult::ASSIGNMENT_REQUEST_RESULT_UNKNOWN:
+ VLOG(0) << "Assignment connection attempt result unknown";
Kevin M 2016/09/27 21:59:40 These should probably be LOG(INFO|ERROR) or DLOG()
Kevin M 2016/09/27 21:59:41 "Connection" isn't a good term here and elsewhere.
steimel 2016/09/27 23:23:19 Done.
+ break;
+ case AssignmentRequestResult::ASSIGNMENT_REQUEST_RESULT_OK:
Kevin M 2016/09/27 21:59:40 Move success case to the top.
steimel 2016/09/27 23:23:19 Done.
+ VLOG(0) << "Assignment connection success";
+ break;
+ default:
Kevin M 2016/09/27 21:59:40 Don't use "default" if you can avoid it - this let
steimel 2016/09/27 23:23:19 Done.
+ VLOG(0) << "Assignment connection error: " << result;
+ break;
+ }
+}
+
+std::unique_ptr<IdentityProvider>
+BlimpClientContextDelegateLinux::CreateIdentityProvider() {
+ return base::MakeUnique<BlimpDefaultIdentityProvider>();
+}
+
+void BlimpClientContextDelegateLinux::OnAuthenticationError(
+ BlimpClientContextDelegate::AuthError error) {
+ switch (error) {
+ case BlimpClientContextDelegate::AuthError::NOT_SIGNED_IN:
+ VLOG(0) << "Error: Not signed in";
Kevin M 2016/09/27 21:59:41 LOG(ERROR)
steimel 2016/09/27 23:23:19 Done.
+ break;
+ case BlimpClientContextDelegate::AuthError::OAUTH_TOKEN_FAIL:
+ VLOG(0) << "Error: OAuth token failure";
+ break;
+ }
+}
+
+} // namespace client
+} // namespace blimp

Powered by Google App Engine
This is Rietveld 408576698