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

Side by Side Diff: chrome/browser/chromeos/arc/arc_play_store_enabled_preference_handler.cc

Issue 2734873002: Fix ArcSessionManager state machine, part 2. (Closed)
Patch Set: Address comments. Created 3 years, 9 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
« no previous file with comments | « no previous file | chrome/browser/chromeos/arc/arc_session_manager.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/arc/arc_session_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698