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

Side by Side Diff: chrome/browser/chromeos/arc/arc_session_manager.cc

Issue 2554743003: arc: Fix double provisioning failure reporting. (Closed)
Patch Set: remove not required flag reset Created 4 years 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
« no previous file with comments | « chrome/browser/chromeos/arc/arc_session_manager.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "chrome/browser/chromeos/arc/arc_session_manager.h" 5 #include "chrome/browser/chromeos/arc/arc_session_manager.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "ash/common/shelf/shelf_delegate.h" 9 #include "ash/common/shelf/shelf_delegate.h"
10 #include "ash/common/wm_shell.h" 10 #include "ash/common/wm_shell.h"
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 239
240 // Restart ARC anyway. Let the enterprise reporting instance decide whether 240 // Restart ARC anyway. Let the enterprise reporting instance decide whether
241 // the ARC user data wipe is still required or not. 241 // the ARC user data wipe is still required or not.
242 reenable_arc_ = false; 242 reenable_arc_ = false;
243 VLOG(1) << "Reenable ARC"; 243 VLOG(1) << "Reenable ARC";
244 EnableArc(); 244 EnableArc();
245 } 245 }
246 246
247 void ArcSessionManager::OnProvisioningFinished(ProvisioningResult result) { 247 void ArcSessionManager::OnProvisioningFinished(ProvisioningResult result) {
248 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); 248 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
249 DCHECK_EQ(state_, State::ACTIVE); 249 DCHECK_EQ(state_, State::ACTIVE);
Luis Héctor Chávez 2016/12/06 17:50:45 Move this after L258, because the state won't be S
khmel 2016/12/06 18:13:35 This code is dropped in next CL https://codereview
250 250
251 if (result != ProvisioningResult::SUCCESS) {
252 if (provisioning_error_reported_) {
253 LOG(WARNING) << " Provisioning error was already reported. Ignoring "
254 << " additional error " << static_cast<int>(result) << ".";
255 return;
256 }
257 provisioning_error_reported_ = true;
258 }
259
251 if (result == ProvisioningResult::CHROME_SERVER_COMMUNICATION_ERROR) { 260 if (result == ProvisioningResult::CHROME_SERVER_COMMUNICATION_ERROR) {
252 if (IsArcKioskMode()) { 261 if (IsArcKioskMode()) {
253 VLOG(1) << "Robot account auth code fetching error"; 262 VLOG(1) << "Robot account auth code fetching error";
254 // Log out the user. All the cleanup will be done in Shutdown() method. 263 // Log out the user. All the cleanup will be done in Shutdown() method.
255 // The callback is not called because auth code is empty. 264 // The callback is not called because auth code is empty.
256 chrome::AttemptUserExit(); 265 chrome::AttemptUserExit();
257 return; 266 return;
258 } 267 }
259 268
260 // For backwards compatibility, use NETWORK_ERROR for 269 // For backwards compatibility, use NETWORK_ERROR for
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
584 // TODO(hidehiko): Remove this. 593 // TODO(hidehiko): Remove this.
585 void ArcSessionManager::StopAndEnableArc() { 594 void ArcSessionManager::StopAndEnableArc() {
586 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); 595 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
587 DCHECK(!arc_bridge_service()->stopped()); 596 DCHECK(!arc_bridge_service()->stopped());
588 reenable_arc_ = true; 597 reenable_arc_ = true;
589 StopArc(); 598 StopArc();
590 } 599 }
591 600
592 void ArcSessionManager::StartArc() { 601 void ArcSessionManager::StartArc() {
593 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); 602 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
603 provisioning_error_reported_ = false;
594 arc_bridge_service()->RequestStart(); 604 arc_bridge_service()->RequestStart();
595 SetState(State::ACTIVE); 605 SetState(State::ACTIVE);
596 } 606 }
597 607
598 void ArcSessionManager::OnArcSignInTimeout() { 608 void ArcSessionManager::OnArcSignInTimeout() {
599 LOG(ERROR) << "Timed out waiting for first sign in."; 609 LOG(ERROR) << "Timed out waiting for first sign in.";
600 OnProvisioningFinished(ProvisioningResult::OVERALL_SIGN_IN_TIMEOUT); 610 OnProvisioningFinished(ProvisioningResult::OVERALL_SIGN_IN_TIMEOUT);
601 } 611 }
602 612
603 void ArcSessionManager::CancelAuthCode() { 613 void ArcSessionManager::CancelAuthCode() {
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
853 return os << "ACTIVE"; 863 return os << "ACTIVE";
854 } 864 }
855 865
856 // Some compiler reports an error even if all values of an enum-class are 866 // Some compiler reports an error even if all values of an enum-class are
857 // covered indivisually in a switch statement. 867 // covered indivisually in a switch statement.
858 NOTREACHED(); 868 NOTREACHED();
859 return os; 869 return os;
860 } 870 }
861 871
862 } // namespace arc 872 } // namespace arc
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/arc/arc_session_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698