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

Side by Side Diff: chrome/browser/chromeos/arc/optin/arc_terms_of_service_default_negotiator.cc

Issue 2682833003: Skip ARC initial screen when everything is set up by policy (Closed)
Patch Set: Make tests parametric Created 3 years, 10 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/optin/arc_terms_of_service_default_negotia tor.h" 5 #include "chrome/browser/chromeos/arc/optin/arc_terms_of_service_default_negotia tor.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "chrome/browser/chromeos/arc/optin/arc_optin_preference_handler.h" 10 #include "chrome/browser/chromeos/arc/optin/arc_optin_preference_handler.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 } 74 }
75 75
76 void ArcTermsOfServiceDefaultNegotiator::OnMetricsModeChanged(bool enabled, 76 void ArcTermsOfServiceDefaultNegotiator::OnMetricsModeChanged(bool enabled,
77 bool managed) { 77 bool managed) {
78 support_host_->SetMetricsPreferenceCheckbox(enabled, managed); 78 support_host_->SetMetricsPreferenceCheckbox(enabled, managed);
79 } 79 }
80 80
81 void ArcTermsOfServiceDefaultNegotiator::OnBackupAndRestoreModeChanged( 81 void ArcTermsOfServiceDefaultNegotiator::OnBackupAndRestoreModeChanged(
82 bool enabled, 82 bool enabled,
83 bool managed) { 83 bool managed) {
84 support_host_->SetBackupAndRestorePreferenceCheckbox(enabled, managed); 84 // Tick the checkbox by default in the unmanaged case, regardless of the pref
hidehiko 2017/02/15 04:59:16 Ok, then, could you move them to arc_optin_prefere
emaxx 2017/02/15 05:12:31 Hmm, but would it be more appropriate in ArcOptinP
hidehiko 2017/02/15 14:38:43 I think it is ok to modify ArcOptinPreferenceHandl
85 // value (which is false by default). In the managed case, follow the managed
86 // value.
87 const bool checkbox_checked = enabled || !managed;
88 support_host_->SetBackupAndRestorePreferenceCheckbox(checkbox_checked,
89 managed);
85 } 90 }
86 91
87 void ArcTermsOfServiceDefaultNegotiator::OnLocationServicesModeChanged( 92 void ArcTermsOfServiceDefaultNegotiator::OnLocationServicesModeChanged(
88 bool enabled, 93 bool enabled,
89 bool managed) { 94 bool managed) {
90 support_host_->SetLocationServicesPreferenceCheckbox(enabled, managed); 95 // Tick the checkbox by default in the unmanaged case, regardless of the pref
96 // value (which is false by default). In the managed case, follow the managed
97 // value.
98 const bool checkbox_checked = enabled || !managed;
99 support_host_->SetLocationServicesPreferenceCheckbox(checkbox_checked,
100 managed);
91 } 101 }
92 102
93 } // namespace arc 103 } // namespace arc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698