| 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/login/screens/arc_terms_of_service_screen.h" | 5 #include "chrome/browser/chromeos/login/screens/arc_terms_of_service_screen.h" |
| 6 | 6 |
| 7 #include "chrome/browser/chromeos/arc/arc_session_manager.h" |
| 7 #include "chrome/browser/chromeos/login/screens/base_screen_delegate.h" | 8 #include "chrome/browser/chromeos/login/screens/base_screen_delegate.h" |
| 8 #include "chrome/browser/chromeos/login/wizard_controller.h" | 9 #include "chrome/browser/chromeos/login/wizard_controller.h" |
| 9 #include "chrome/browser/metrics/metrics_reporting_state.h" | 10 #include "chrome/browser/metrics/metrics_reporting_state.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 11 #include "chrome/browser/profiles/profile.h" |
| 11 #include "chrome/browser/profiles/profile_manager.h" | 12 #include "chrome/browser/profiles/profile_manager.h" |
| 12 #include "chrome/common/pref_names.h" | 13 #include "chrome/common/pref_names.h" |
| 13 #include "components/prefs/pref_service.h" | 14 #include "components/prefs/pref_service.h" |
| 14 | 15 |
| 15 namespace chromeos { | 16 namespace chromeos { |
| 16 | 17 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 void ArcTermsOfServiceScreen::OnSkip() { | 49 void ArcTermsOfServiceScreen::OnSkip() { |
| 49 ApplyTerms(false); | 50 ApplyTerms(false); |
| 50 } | 51 } |
| 51 | 52 |
| 52 void ArcTermsOfServiceScreen::OnAccept() { | 53 void ArcTermsOfServiceScreen::OnAccept() { |
| 53 ApplyTerms(true); | 54 ApplyTerms(true); |
| 54 } | 55 } |
| 55 | 56 |
| 56 void ArcTermsOfServiceScreen::ApplyTerms(bool accepted) { | 57 void ArcTermsOfServiceScreen::ApplyTerms(bool accepted) { |
| 57 Profile* profile = ProfileManager::GetActiveUserProfile(); | 58 Profile* profile = ProfileManager::GetActiveUserProfile(); |
| 59 |
| 60 if (accepted) { |
| 61 arc::ArcSessionManager* session_manager = arc::ArcSessionManager::Get(); |
| 62 DCHECK_EQ(session_manager->profile(), profile); |
| 63 if (session_manager->support_host()) |
| 64 session_manager->support_host()->SetSilentMode(); |
| 65 } |
| 66 |
| 58 profile->GetPrefs()->SetBoolean(prefs::kArcTermsAccepted, accepted); | 67 profile->GetPrefs()->SetBoolean(prefs::kArcTermsAccepted, accepted); |
| 59 profile->GetPrefs()->SetBoolean(prefs::kArcEnabled, accepted); | 68 profile->GetPrefs()->SetBoolean(prefs::kArcEnabled, accepted); |
| 60 | 69 |
| 61 Finish(BaseScreenDelegate::ARC_TERMS_OF_SERVICE_FINISHED); | 70 Finish(BaseScreenDelegate::ARC_TERMS_OF_SERVICE_FINISHED); |
| 62 } | 71 } |
| 63 | 72 |
| 64 void ArcTermsOfServiceScreen::OnActorDestroyed( | 73 void ArcTermsOfServiceScreen::OnActorDestroyed( |
| 65 ArcTermsOfServiceScreenActor* actor) { | 74 ArcTermsOfServiceScreenActor* actor) { |
| 66 DCHECK_EQ(actor, actor_); | 75 DCHECK_EQ(actor, actor_); |
| 67 actor_ = nullptr; | 76 actor_ = nullptr; |
| 68 } | 77 } |
| 69 | 78 |
| 70 } // namespace chromeos | 79 } // namespace chromeos |
| OLD | NEW |