| 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 608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 619 // Reset any pending request to re-enable ARC. | 619 // Reset any pending request to re-enable ARC. |
| 620 reenable_arc_ = false; | 620 reenable_arc_ = false; |
| 621 StopArc(); | 621 StopArc(); |
| 622 VLOG(1) << "ARC opt-out. Removing user data."; | 622 VLOG(1) << "ARC opt-out. Removing user data."; |
| 623 RequestArcDataRemoval(); | 623 RequestArcDataRemoval(); |
| 624 } | 624 } |
| 625 | 625 |
| 626 void ArcSessionManager::RequestArcDataRemoval() { | 626 void ArcSessionManager::RequestArcDataRemoval() { |
| 627 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 627 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 628 DCHECK(profile_); | 628 DCHECK(profile_); |
| 629 |
| 630 // The ArcAvailabilityPolicyStatus check is done to make sure the data is not |
| 631 // removed if the device had ARC enabled and became disabled as result of |
| 632 // migration to ext4 policy. |
| 633 // TODO(igorcov): Remove ArcAvailabilityPolicyStatus check after migration. |
| 634 // crbug.com/725493 |
| 635 if (arc::GetArcAvailabilityPolicyStatus() == |
| 636 arc::ArcAvailabilityPolicyStatus::DISABLED) { |
| 637 return; |
| 638 } |
| 639 |
| 629 // TODO(hidehiko): DCHECK the previous state. This is called for four cases; | 640 // TODO(hidehiko): DCHECK the previous state. This is called for four cases; |
| 630 // 1) Supporting managed user initial disabled case (Please see also | 641 // 1) Supporting managed user initial disabled case (Please see also |
| 631 // ArcPlayStoreEnabledPreferenceHandler::Start() for details). | 642 // ArcPlayStoreEnabledPreferenceHandler::Start() for details). |
| 632 // 2) Supporting enterprise triggered data removal. | 643 // 2) Supporting enterprise triggered data removal. |
| 633 // 3) One called in OnProvisioningFinished(). | 644 // 3) One called in OnProvisioningFinished(). |
| 634 // 4) On request disabling. | 645 // 4) On request disabling. |
| 635 // After the state machine is fixed, 2) should be replaced by | 646 // After the state machine is fixed, 2) should be replaced by |
| 636 // RequestDisable() immediately followed by RequestEnable(). | 647 // RequestDisable() immediately followed by RequestEnable(). |
| 637 // 3) and 4) are internal state transition. So, as for public interface, 1) | 648 // 3) and 4) are internal state transition. So, as for public interface, 1) |
| 638 // should be the only use case, and the |state_| should be limited to | 649 // should be the only use case, and the |state_| should be limited to |
| (...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1050 | 1061 |
| 1051 #undef MAP_STATE | 1062 #undef MAP_STATE |
| 1052 | 1063 |
| 1053 // Some compilers report an error even if all values of an enum-class are | 1064 // Some compilers report an error even if all values of an enum-class are |
| 1054 // covered exhaustively in a switch statement. | 1065 // covered exhaustively in a switch statement. |
| 1055 NOTREACHED() << "Invalid value " << static_cast<int>(state); | 1066 NOTREACHED() << "Invalid value " << static_cast<int>(state); |
| 1056 return os; | 1067 return os; |
| 1057 } | 1068 } |
| 1058 | 1069 |
| 1059 } // namespace arc | 1070 } // namespace arc |
| OLD | NEW |