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

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

Issue 2890843002: Policy implementation for encryptfs to ext4 migration strategy (Closed)
Patch Set: Fixed review comments Created 3 years, 6 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 "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 "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback_helpers.h" 10 #include "base/callback_helpers.h"
(...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after
622 // Reset any pending request to re-enable ARC. 622 // Reset any pending request to re-enable ARC.
623 reenable_arc_ = false; 623 reenable_arc_ = false;
624 StopArc(); 624 StopArc();
625 VLOG(1) << "ARC opt-out. Removing user data."; 625 VLOG(1) << "ARC opt-out. Removing user data.";
626 RequestArcDataRemoval(); 626 RequestArcDataRemoval();
627 } 627 }
628 628
629 void ArcSessionManager::RequestArcDataRemoval() { 629 void ArcSessionManager::RequestArcDataRemoval() {
630 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); 630 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
631 DCHECK(profile_); 631 DCHECK(profile_);
632
633 // The check if migration is allowed is done to make sure the data is not
634 // removed if the device had ARC enabled and became disabled as result of
635 // migration to ext4 policy.
636 // TODO(igorcov): Remove this check after migration. crbug.com/725493
637 if (!arc::IsArcMigrationAllowed()) {
638 return;
bartfab (slow) 2017/06/12 12:49:03 Can we add a unit test for this? It would be very
igorcov 2017/06/12 16:50:09 As far as I understand the code, this should be a
639 }
640
632 // TODO(hidehiko): DCHECK the previous state. This is called for four cases; 641 // TODO(hidehiko): DCHECK the previous state. This is called for four cases;
633 // 1) Supporting managed user initial disabled case (Please see also 642 // 1) Supporting managed user initial disabled case (Please see also
634 // ArcPlayStoreEnabledPreferenceHandler::Start() for details). 643 // ArcPlayStoreEnabledPreferenceHandler::Start() for details).
635 // 2) Supporting enterprise triggered data removal. 644 // 2) Supporting enterprise triggered data removal.
636 // 3) One called in OnProvisioningFinished(). 645 // 3) One called in OnProvisioningFinished().
637 // 4) On request disabling. 646 // 4) On request disabling.
638 // After the state machine is fixed, 2) should be replaced by 647 // After the state machine is fixed, 2) should be replaced by
639 // RequestDisable() immediately followed by RequestEnable(). 648 // RequestDisable() immediately followed by RequestEnable().
640 // 3) and 4) are internal state transition. So, as for public interface, 1) 649 // 3) and 4) are internal state transition. So, as for public interface, 1)
641 // should be the only use case, and the |state_| should be limited to 650 // should be the only use case, and the |state_| should be limited to
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after
1039 1048
1040 #undef MAP_STATE 1049 #undef MAP_STATE
1041 1050
1042 // Some compilers report an error even if all values of an enum-class are 1051 // Some compilers report an error even if all values of an enum-class are
1043 // covered exhaustively in a switch statement. 1052 // covered exhaustively in a switch statement.
1044 NOTREACHED() << "Invalid value " << static_cast<int>(state); 1053 NOTREACHED() << "Invalid value " << static_cast<int>(state);
1045 return os; 1054 return os;
1046 } 1055 }
1047 1056
1048 } // namespace arc 1057 } // namespace arc
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/arc/arc_util.h » ('j') | chrome/browser/chromeos/arc/arc_util.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698