Chromium Code Reviews| 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 613 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 624 // should be the only use case, and the |state_| should be limited to | 624 // should be the only use case, and the |state_| should be limited to |
| 625 // STOPPED, then. | 625 // STOPPED, then. |
| 626 // TODO(hidehiko): Think a way to get rid of 1), too. | 626 // TODO(hidehiko): Think a way to get rid of 1), too. |
| 627 | 627 |
| 628 // Just remember the request in persistent data. The actual removal | 628 // Just remember the request in persistent data. The actual removal |
| 629 // is done via MaybeStartArcDataRemoval(). On completion (in | 629 // is done via MaybeStartArcDataRemoval(). On completion (in |
| 630 // OnArcDataRemoved()), this flag should be reset. | 630 // OnArcDataRemoved()), this flag should be reset. |
| 631 profile_->GetPrefs()->SetBoolean(prefs::kArcDataRemoveRequested, true); | 631 profile_->GetPrefs()->SetBoolean(prefs::kArcDataRemoveRequested, true); |
| 632 | 632 |
| 633 // To support 1) case above, maybe start data removal. | 633 // To support 1) case above, maybe start data removal. |
| 634 if (state_ == State::STOPPED && arc_session_runner_->IsStopped()) | 634 // The ArcAvailabilityPolicyStatus check is added to make sure the data is not |
| 635 // removed if the device had ARC enabled and became disabled as result of | |
| 636 // migration to ext4 policy. | |
| 637 // TODO(igorcov): Remove ArcAvailabilityPolicyStatus check after migration. | |
| 638 // crbug.com/725493 | |
| 639 if (state_ == State::STOPPED && arc_session_runner_->IsStopped() && | |
| 640 arc::GetArcAvailabilityPolicyStatus() != | |
|
hidehiko
2017/05/25 12:41:55
Setting kArcDataRemoveRequested pref needs to be g
igorcov
2017/05/31 17:25:35
Done.
| |
| 641 arc::ARC_AVAILABILITY_POLICY_STATUS::DISABLED) | |
| 635 MaybeStartArcDataRemoval(); | 642 MaybeStartArcDataRemoval(); |
| 636 } | 643 } |
| 637 | 644 |
| 638 void ArcSessionManager::MaybeStartTermsOfServiceNegotiation() { | 645 void ArcSessionManager::MaybeStartTermsOfServiceNegotiation() { |
| 639 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 646 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 640 DCHECK(profile_); | 647 DCHECK(profile_); |
| 641 DCHECK(!terms_of_service_negotiator_); | 648 DCHECK(!terms_of_service_negotiator_); |
| 642 // In Kiosk-mode, Terms of Service negotiation should be skipped. | 649 // In Kiosk-mode, Terms of Service negotiation should be skipped. |
| 643 // See also RequestEnableImpl(). | 650 // See also RequestEnableImpl(). |
| 644 DCHECK(!IsArcKioskMode()); | 651 DCHECK(!IsArcKioskMode()); |
| (...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1036 | 1043 |
| 1037 #undef MAP_STATE | 1044 #undef MAP_STATE |
| 1038 | 1045 |
| 1039 // Some compilers report an error even if all values of an enum-class are | 1046 // Some compilers report an error even if all values of an enum-class are |
| 1040 // covered exhaustively in a switch statement. | 1047 // covered exhaustively in a switch statement. |
| 1041 NOTREACHED() << "Invalid value " << static_cast<int>(state); | 1048 NOTREACHED() << "Invalid value " << static_cast<int>(state); |
| 1042 return os; | 1049 return os; |
| 1043 } | 1050 } |
| 1044 | 1051 |
| 1045 } // namespace arc | 1052 } // namespace arc |
| OLD | NEW |