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

Side by Side Diff: blimp/client/app/linux/blimp_client_context_delegate_linux.cc

Issue 2391263005: Propagate error messages to UI for blimp. (Closed)
Patch Set: Minor fixes. Created 4 years, 2 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 unified diff | Download patch
OLDNEW
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 "base/memory/ptr_util.h" 5 #include "base/memory/ptr_util.h"
6 #include "blimp/client/app/linux/blimp_client_context_delegate_linux.h" 6 #include "blimp/client/app/linux/blimp_client_context_delegate_linux.h"
7 #include "blimp/client/support/session/blimp_default_identity_provider.h" 7 #include "blimp/client/support/session/blimp_default_identity_provider.h"
8 #include "net/base/net_errors.h"
8 9
9 namespace blimp { 10 namespace blimp {
10 namespace client { 11 namespace client {
11 12
12 BlimpClientContextDelegateLinux::BlimpClientContextDelegateLinux() = default; 13 BlimpClientContextDelegateLinux::BlimpClientContextDelegateLinux() = default;
13 14
14 BlimpClientContextDelegateLinux::~BlimpClientContextDelegateLinux() = default; 15 BlimpClientContextDelegateLinux::~BlimpClientContextDelegateLinux() = default;
15 16
16 void BlimpClientContextDelegateLinux::AttachBlimpContentsHelpers( 17 void BlimpClientContextDelegateLinux::AttachBlimpContentsHelpers(
17 BlimpContents* blimp_contents) {} 18 BlimpContents* blimp_contents) {}
18 19
19 void BlimpClientContextDelegateLinux::OnAssignmentConnectionAttempted( 20 void BlimpClientContextDelegateLinux::OnAssignmentConnectionAttempted(
20 AssignmentRequestResult result, 21 AssignmentRequestResult result,
21 const Assignment& assignment) { 22 const Assignment& assignment) {
22 // TODO(xingliu): Update this to use the new error strings and logging helper 23 // TODO(xingliu): Update this to use the new error strings and logging helper
23 // methods. 24 // methods, and access the string from grd files. https://crbug.com/630687
24 switch (result) { 25 switch (result) {
25 case AssignmentRequestResult::ASSIGNMENT_REQUEST_RESULT_OK: 26 case AssignmentRequestResult::ASSIGNMENT_REQUEST_RESULT_OK:
26 VLOG(0) << "Assignment request success"; 27 VLOG(0) << "Assignment request success";
27 break; 28 break;
28 case AssignmentRequestResult::ASSIGNMENT_REQUEST_RESULT_UNKNOWN: 29 case AssignmentRequestResult::ASSIGNMENT_REQUEST_RESULT_UNKNOWN:
29 LOG(WARNING) << "Assignment request result unknown"; 30 LOG(WARNING) << "Assignment request result unknown";
30 break; 31 break;
31 case AssignmentRequestResult::ASSIGNMENT_REQUEST_RESULT_BAD_REQUEST: 32 case AssignmentRequestResult::ASSIGNMENT_REQUEST_RESULT_BAD_REQUEST:
32 LOG(WARNING) << "Assignment request error: Bad request"; 33 LOG(WARNING) << "Assignment request error: Bad request";
33 break; 34 break;
(...skipping 28 matching lines...) Expand all
62 break; 63 break;
63 } 64 }
64 } 65 }
65 66
66 std::unique_ptr<IdentityProvider> 67 std::unique_ptr<IdentityProvider>
67 BlimpClientContextDelegateLinux::CreateIdentityProvider() { 68 BlimpClientContextDelegateLinux::CreateIdentityProvider() {
68 return base::MakeUnique<BlimpDefaultIdentityProvider>(); 69 return base::MakeUnique<BlimpDefaultIdentityProvider>();
69 } 70 }
70 71
71 void BlimpClientContextDelegateLinux::OnAuthenticationError( 72 void BlimpClientContextDelegateLinux::OnAuthenticationError(
72 BlimpClientContextDelegate::AuthError error) { 73 const GoogleServiceAuthError& error) {
73 // TODO(xingliu): Update this to use the new error strings and logging helper 74 LOG(WARNING) << "GoogleAuth error : " << error.ToString();
74 // methods. 75 }
75 switch (error) { 76
76 case BlimpClientContextDelegate::AuthError::NOT_SIGNED_IN: 77 void BlimpClientContextDelegateLinux::OnConnected() {
77 LOG(WARNING) << "Error: Not signed in"; 78 VLOG(1) << "Connected.";
78 break; 79 }
79 case BlimpClientContextDelegate::AuthError::OAUTH_TOKEN_FAIL: 80
80 LOG(WARNING) << "Error: OAuth token failure"; 81 void BlimpClientContextDelegateLinux::OnEngineDisconnected(int result) {
81 break; 82 LOG(WARNING) << "Disconnected from the engine, reason: " << result;
82 } 83 }
84
85 void BlimpClientContextDelegateLinux::OnNetworkDisconnected(int result) {
86 LOG(WARNING) << "Disconnected, reason: " << net::ErrorToShortString(result);
83 } 87 }
84 88
85 } // namespace client 89 } // namespace client
86 } // namespace blimp 90 } // namespace blimp
OLDNEW
« no previous file with comments | « blimp/client/app/linux/blimp_client_context_delegate_linux.h ('k') | blimp/client/core/context/blimp_client_context_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698