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

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: 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
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 The Chromium Authors. All rights reserved.
Yusuke Sato 2017/03/06 21:39:59 In the CL description, can you add a link to the P
Yusuke Sato 2017/03/07 21:03:08 ping?
hidehiko 2017/03/09 09:25:50 Oops. Done.
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"
11 #include "base/logging.h" 11 #include "base/logging.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 if (IsArcPlayStoreEnabledPreferenceManagedForProfile(profile_)) { 64 if (IsArcPlayStoreEnabledPreferenceManagedForProfile(profile_)) {
65 // All users that can disable Google Play Store by themselves will have 65 // All users that can disable Google Play Store by themselves will have
66 // the |kARcDataRemoveRequested| pref set, so we don't need to eagerly 66 // the |kARcDataRemoveRequested| pref set, so we don't need to eagerly
67 // remove the data for that case. 67 // remove the data for that case.
68 // For managed users, the preference can change when the Profile object is 68 // For managed users, the preference can change when the Profile object is
69 // not alive, so we still need to check it here in case it was disabled to 69 // not alive, so we still need to check it here in case it was disabled to
70 // ensure that the data is deleted in case it was disabled between 70 // ensure that the data is deleted in case it was disabled between
71 // launches. 71 // launches.
72 VLOG(1) << "Google Play Store is initially disabled for managed " 72 VLOG(1) << "Google Play Store is initially disabled for managed "
73 << "profile. Removing data."; 73 << "profile. Removing data.";
74 arc_session_manager_->RemoveArcData(); 74 arc_session_manager_->RequestArcDataRemoval();
75 } 75 }
76 76
77 // ArcAuthNotification may need to be shown. 77 // ArcAuthNotification may need to be shown.
78 PrefServiceSyncableFromProfile(profile_)->AddObserver(this); 78 PrefServiceSyncableFromProfile(profile_)->AddObserver(this);
79 OnIsSyncingChanged(); 79 OnIsSyncingChanged();
80 } 80 }
81 81
82 void ArcPlayStoreEnabledPreferenceHandler::OnPreferenceChanged() { 82 void ArcPlayStoreEnabledPreferenceHandler::OnPreferenceChanged() {
83 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); 83 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
84 84
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 // TODO(hidehiko): Extract kEnableArcOOBEOptIn check as a utility method. 136 // TODO(hidehiko): Extract kEnableArcOOBEOptIn check as a utility method.
137 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( 137 if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
138 chromeos::switches::kEnableArcOOBEOptIn) && 138 chromeos::switches::kEnableArcOOBEOptIn) &&
139 profile_->IsNewProfile() && 139 profile_->IsNewProfile() &&
140 !profile_->GetPrefs()->HasPrefPath(prefs::kArcEnabled)) { 140 !profile_->GetPrefs()->HasPrefPath(prefs::kArcEnabled)) {
141 ArcAuthNotification::Show(profile_); 141 ArcAuthNotification::Show(profile_);
142 } 142 }
143 } 143 }
144 144
145 } // namespace arc 145 } // namespace arc
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/arc/arc_session_manager.h » ('j') | chrome/browser/chromeos/arc/arc_session_manager.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698