| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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_play_store_enabled_preference_handler.
h" | 5 #include "chrome/browser/chromeos/arc/arc_play_store_enabled_preference_handler.
h" |
| 6 | 6 |
| 7 #include "ash/common/shelf/shelf_delegate.h" | 7 #include "ash/common/shelf/shelf_delegate.h" |
| 8 #include "ash/common/wm_shell.h" | 8 #include "ash/common/wm_shell.h" |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 if (IsArcPlayStoreEnabledPreferenceManagedForProfile(profile_)) { | 65 if (IsArcPlayStoreEnabledPreferenceManagedForProfile(profile_)) { |
| 66 // All users that can disable Google Play Store by themselves will have | 66 // All users that can disable Google Play Store by themselves will have |
| 67 // the |kARcDataRemoveRequested| pref set, so we don't need to eagerly | 67 // the |kARcDataRemoveRequested| pref set, so we don't need to eagerly |
| 68 // remove the data for that case. | 68 // remove the data for that case. |
| 69 // For managed users, the preference can change when the Profile object is | 69 // For managed users, the preference can change when the Profile object is |
| 70 // not alive, so we still need to check it here in case it was disabled to | 70 // not alive, so we still need to check it here in case it was disabled to |
| 71 // ensure that the data is deleted in case it was disabled between | 71 // ensure that the data is deleted in case it was disabled between |
| 72 // launches. | 72 // launches. |
| 73 VLOG(1) << "Google Play Store is initially disabled for managed " | 73 VLOG(1) << "Google Play Store is initially disabled for managed " |
| 74 << "profile. Removing data."; | 74 << "profile. Removing data."; |
| 75 arc_session_manager_->RemoveArcData(); | 75 arc_session_manager_->RequestArcDataRemoval(); |
| 76 } | 76 } |
| 77 | 77 |
| 78 // ArcAuthNotification may need to be shown. | 78 // ArcAuthNotification may need to be shown. |
| 79 PrefServiceSyncableFromProfile(profile_)->AddObserver(this); | 79 PrefServiceSyncableFromProfile(profile_)->AddObserver(this); |
| 80 OnIsSyncingChanged(); | 80 OnIsSyncingChanged(); |
| 81 } | 81 } |
| 82 | 82 |
| 83 void ArcPlayStoreEnabledPreferenceHandler::OnPreferenceChanged() { | 83 void ArcPlayStoreEnabledPreferenceHandler::OnPreferenceChanged() { |
| 84 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 84 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 85 | 85 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 // TODO(hidehiko): Extract kEnableArcOOBEOptIn check as a utility method. | 137 // TODO(hidehiko): Extract kEnableArcOOBEOptIn check as a utility method. |
| 138 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( | 138 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 139 chromeos::switches::kEnableArcOOBEOptIn) && | 139 chromeos::switches::kEnableArcOOBEOptIn) && |
| 140 profile_->IsNewProfile() && | 140 profile_->IsNewProfile() && |
| 141 !profile_->GetPrefs()->HasPrefPath(prefs::kArcEnabled)) { | 141 !profile_->GetPrefs()->HasPrefPath(prefs::kArcEnabled)) { |
| 142 ArcAuthNotification::Show(profile_); | 142 ArcAuthNotification::Show(profile_); |
| 143 } | 143 } |
| 144 } | 144 } |
| 145 | 145 |
| 146 } // namespace arc | 146 } // namespace arc |
| OLD | NEW |