| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "base/memory/ptr_util.h" |
| 6 #include "blimp/client/app/linux/blimp_client_context_delegate_linux.h" |
| 7 #include "blimp/client/support/session/blimp_default_identity_provider.h" |
| 8 |
| 9 namespace blimp { |
| 10 namespace client { |
| 11 |
| 12 BlimpClientContextDelegateLinux::BlimpClientContextDelegateLinux() = default; |
| 13 |
| 14 BlimpClientContextDelegateLinux::~BlimpClientContextDelegateLinux() = default; |
| 15 |
| 16 void BlimpClientContextDelegateLinux::AttachBlimpContentsHelpers( |
| 17 BlimpContents* blimp_contents) {} |
| 18 |
| 19 void BlimpClientContextDelegateLinux::OnAssignmentConnectionAttempted( |
| 20 AssignmentRequestResult result, |
| 21 const Assignment& assignment) { |
| 22 // TODO(xingliu): Update this to use the new error strings and logging helper |
| 23 // methods. |
| 24 switch (result) { |
| 25 case AssignmentRequestResult::ASSIGNMENT_REQUEST_RESULT_OK: |
| 26 VLOG(0) << "Assignment request success"; |
| 27 break; |
| 28 case AssignmentRequestResult::ASSIGNMENT_REQUEST_RESULT_UNKNOWN: |
| 29 LOG(WARNING) << "Assignment request result unknown"; |
| 30 break; |
| 31 case AssignmentRequestResult::ASSIGNMENT_REQUEST_RESULT_BAD_REQUEST: |
| 32 LOG(WARNING) << "Assignment request error: Bad request"; |
| 33 break; |
| 34 case AssignmentRequestResult::ASSIGNMENT_REQUEST_RESULT_BAD_RESPONSE: |
| 35 LOG(WARNING) << "Assignment request error: Bad response"; |
| 36 break; |
| 37 case AssignmentRequestResult:: |
| 38 ASSIGNMENT_REQUEST_RESULT_INVALID_PROTOCOL_VERSION: |
| 39 LOG(WARNING) << "Assignment request error: Invalid protocol version"; |
| 40 break; |
| 41 case AssignmentRequestResult:: |
| 42 ASSIGNMENT_REQUEST_RESULT_EXPIRED_ACCESS_TOKEN: |
| 43 LOG(WARNING) << "Assignment request error: Expired access token"; |
| 44 break; |
| 45 case AssignmentRequestResult::ASSIGNMENT_REQUEST_RESULT_USER_INVALID: |
| 46 LOG(WARNING) << "Assignment request error: User invalid"; |
| 47 break; |
| 48 case AssignmentRequestResult::ASSIGNMENT_REQUEST_RESULT_OUT_OF_VMS: |
| 49 LOG(WARNING) << "Assignment request error: Out of VMs"; |
| 50 break; |
| 51 case AssignmentRequestResult::ASSIGNMENT_REQUEST_RESULT_SERVER_ERROR: |
| 52 LOG(WARNING) << "Assignment request error: Server error"; |
| 53 break; |
| 54 case AssignmentRequestResult::ASSIGNMENT_REQUEST_RESULT_SERVER_INTERRUPTED: |
| 55 LOG(WARNING) << "Assignment request error: Server interrupted"; |
| 56 break; |
| 57 case AssignmentRequestResult::ASSIGNMENT_REQUEST_RESULT_NETWORK_FAILURE: |
| 58 LOG(WARNING) << "Assignment request error: Network failure"; |
| 59 break; |
| 60 case AssignmentRequestResult::ASSIGNMENT_REQUEST_RESULT_INVALID_CERT: |
| 61 LOG(WARNING) << "Assignment request error: Invalid cert"; |
| 62 break; |
| 63 } |
| 64 } |
| 65 |
| 66 std::unique_ptr<IdentityProvider> |
| 67 BlimpClientContextDelegateLinux::CreateIdentityProvider() { |
| 68 return base::MakeUnique<BlimpDefaultIdentityProvider>(); |
| 69 } |
| 70 |
| 71 void BlimpClientContextDelegateLinux::OnAuthenticationError( |
| 72 BlimpClientContextDelegate::AuthError error) { |
| 73 // TODO(xingliu): Update this to use the new error strings and logging helper |
| 74 // methods. |
| 75 switch (error) { |
| 76 case BlimpClientContextDelegate::AuthError::NOT_SIGNED_IN: |
| 77 LOG(WARNING) << "Error: Not signed in"; |
| 78 break; |
| 79 case BlimpClientContextDelegate::AuthError::OAUTH_TOKEN_FAIL: |
| 80 LOG(WARNING) << "Error: OAuth token failure"; |
| 81 break; |
| 82 } |
| 83 } |
| 84 |
| 85 } // namespace client |
| 86 } // namespace blimp |
| OLD | NEW |