| OLD | NEW |
| 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 Loading... |
| 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 ArcAvailabilityPolicyStatus check after migration. |
| 637 // crbug.com/725493 |
| 638 if (!arc::IsMigrationAllowed()) { |
| 639 return; |
| 640 } |
| 641 |
| 632 // TODO(hidehiko): DCHECK the previous state. This is called for four cases; | 642 // TODO(hidehiko): DCHECK the previous state. This is called for four cases; |
| 633 // 1) Supporting managed user initial disabled case (Please see also | 643 // 1) Supporting managed user initial disabled case (Please see also |
| 634 // ArcPlayStoreEnabledPreferenceHandler::Start() for details). | 644 // ArcPlayStoreEnabledPreferenceHandler::Start() for details). |
| 635 // 2) Supporting enterprise triggered data removal. | 645 // 2) Supporting enterprise triggered data removal. |
| 636 // 3) One called in OnProvisioningFinished(). | 646 // 3) One called in OnProvisioningFinished(). |
| 637 // 4) On request disabling. | 647 // 4) On request disabling. |
| 638 // After the state machine is fixed, 2) should be replaced by | 648 // After the state machine is fixed, 2) should be replaced by |
| 639 // RequestDisable() immediately followed by RequestEnable(). | 649 // RequestDisable() immediately followed by RequestEnable(). |
| 640 // 3) and 4) are internal state transition. So, as for public interface, 1) | 650 // 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 | 651 // 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 Loading... |
| 1039 | 1049 |
| 1040 #undef MAP_STATE | 1050 #undef MAP_STATE |
| 1041 | 1051 |
| 1042 // Some compilers report an error even if all values of an enum-class are | 1052 // Some compilers report an error even if all values of an enum-class are |
| 1043 // covered exhaustively in a switch statement. | 1053 // covered exhaustively in a switch statement. |
| 1044 NOTREACHED() << "Invalid value " << static_cast<int>(state); | 1054 NOTREACHED() << "Invalid value " << static_cast<int>(state); |
| 1045 return os; | 1055 return os; |
| 1046 } | 1056 } |
| 1047 | 1057 |
| 1048 } // namespace arc | 1058 } // namespace arc |
| OLD | NEW |