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

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 dependency issue found by gn check 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..db7f2ff4fa99d798845ab6798ac93ebe1d3ce2c6
--- /dev/null
+++ b/blimp/client/app/linux/blimp_client_context_delegate_linux.cc
@@ -0,0 +1,86 @@
+// 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) {
+ // TODO(xingliu): Update this to use the new error strings and logging helper
+ // methods.
+ switch (result) {
+ case AssignmentRequestResult::ASSIGNMENT_REQUEST_RESULT_OK:
+ VLOG(0) << "Assignment request success";
+ break;
+ case AssignmentRequestResult::ASSIGNMENT_REQUEST_RESULT_UNKNOWN:
+ LOG(WARNING) << "Assignment request result unknown";
+ break;
+ case AssignmentRequestResult::ASSIGNMENT_REQUEST_RESULT_BAD_REQUEST:
+ LOG(WARNING) << "Assignment request error: Bad request";
+ break;
+ case AssignmentRequestResult::ASSIGNMENT_REQUEST_RESULT_BAD_RESPONSE:
+ LOG(WARNING) << "Assignment request error: Bad response";
+ break;
+ case AssignmentRequestResult::
+ ASSIGNMENT_REQUEST_RESULT_INVALID_PROTOCOL_VERSION:
+ LOG(WARNING) << "Assignment request error: Invalid protocol version";
+ break;
+ case AssignmentRequestResult::
+ ASSIGNMENT_REQUEST_RESULT_EXPIRED_ACCESS_TOKEN:
+ LOG(WARNING) << "Assignment request error: Expired access token";
+ break;
+ case AssignmentRequestResult::ASSIGNMENT_REQUEST_RESULT_USER_INVALID:
+ LOG(WARNING) << "Assignment request error: User invalid";
+ break;
+ case AssignmentRequestResult::ASSIGNMENT_REQUEST_RESULT_OUT_OF_VMS:
+ LOG(WARNING) << "Assignment request error: Out of VMs";
+ break;
+ case AssignmentRequestResult::ASSIGNMENT_REQUEST_RESULT_SERVER_ERROR:
+ LOG(WARNING) << "Assignment request error: Server error";
+ break;
+ case AssignmentRequestResult::ASSIGNMENT_REQUEST_RESULT_SERVER_INTERRUPTED:
+ LOG(WARNING) << "Assignment request error: Server interrupted";
+ break;
+ case AssignmentRequestResult::ASSIGNMENT_REQUEST_RESULT_NETWORK_FAILURE:
+ LOG(WARNING) << "Assignment request error: Network failure";
+ break;
+ case AssignmentRequestResult::ASSIGNMENT_REQUEST_RESULT_INVALID_CERT:
+ LOG(WARNING) << "Assignment request error: Invalid cert";
+ break;
+ }
+}
+
+std::unique_ptr<IdentityProvider>
+BlimpClientContextDelegateLinux::CreateIdentityProvider() {
+ return base::MakeUnique<BlimpDefaultIdentityProvider>();
+}
+
+void BlimpClientContextDelegateLinux::OnAuthenticationError(
+ BlimpClientContextDelegate::AuthError error) {
+ // TODO(xingliu): Update this to use the new error strings and logging helper
+ // methods.
+ switch (error) {
+ case BlimpClientContextDelegate::AuthError::NOT_SIGNED_IN:
+ LOG(WARNING) << "Error: Not signed in";
+ break;
+ case BlimpClientContextDelegate::AuthError::OAUTH_TOKEN_FAIL:
+ LOG(WARNING) << "Error: OAuth token failure";
+ break;
+ }
+}
+
+} // namespace client
+} // namespace blimp
« no previous file with comments | « blimp/client/app/linux/blimp_client_context_delegate_linux.h ('k') | blimp/client/app/linux/blimp_display_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698