| 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/app_mode/arc/arc_kiosk_app_manager.h> | 5 #include <chrome/browser/chromeos/app_mode/arc/arc_kiosk_app_manager.h> | 
| 6 | 6 | 
| 7 #include <algorithm> | 7 #include <algorithm> | 
| 8 #include <utility> | 8 #include <utility> | 
| 9 | 9 | 
| 10 #include "base/barrier_closure.h" | 10 #include "base/barrier_closure.h" | 
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 146   local_accounts_subscription_.reset(); | 146   local_accounts_subscription_.reset(); | 
| 147   local_account_auto_login_id_subscription_.reset(); | 147   local_account_auto_login_id_subscription_.reset(); | 
| 148   apps_.clear(); | 148   apps_.clear(); | 
| 149   g_arc_kiosk_app_manager = nullptr; | 149   g_arc_kiosk_app_manager = nullptr; | 
| 150 } | 150 } | 
| 151 | 151 | 
| 152 const AccountId& ArcKioskAppManager::GetAutoLaunchAccountId() const { | 152 const AccountId& ArcKioskAppManager::GetAutoLaunchAccountId() const { | 
| 153   return auto_launch_account_id_; | 153   return auto_launch_account_id_; | 
| 154 } | 154 } | 
| 155 | 155 | 
|  | 156 const ArcKioskAppManager::ArcKioskApp* ArcKioskAppManager::GetAppByAccountId( | 
|  | 157     const AccountId& account_id) { | 
|  | 158   for (auto& app : GetAllApps()) | 
|  | 159     if (app.account_id() == account_id) | 
|  | 160       return &app; | 
|  | 161   return nullptr; | 
|  | 162 } | 
|  | 163 | 
| 156 void ArcKioskAppManager::AddObserver(ArcKioskAppManagerObserver* observer) { | 164 void ArcKioskAppManager::AddObserver(ArcKioskAppManagerObserver* observer) { | 
| 157   observers_.AddObserver(observer); | 165   observers_.AddObserver(observer); | 
| 158 } | 166 } | 
| 159 | 167 | 
| 160 void ArcKioskAppManager::RemoveObserver(ArcKioskAppManagerObserver* observer) { | 168 void ArcKioskAppManager::RemoveObserver(ArcKioskAppManagerObserver* observer) { | 
| 161   observers_.RemoveObserver(observer); | 169   observers_.RemoveObserver(observer); | 
| 162 } | 170 } | 
| 163 | 171 | 
| 164 void ArcKioskAppManager::UpdateApps() { | 172 void ArcKioskAppManager::UpdateApps() { | 
| 165   // Store current apps. We will compare old and new apps to determine which | 173   // Store current apps. We will compare old and new apps to determine which | 
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 231           cryptohome_id, base::Bind(&OnRemoveAppCryptohomeComplete, | 239           cryptohome_id, base::Bind(&OnRemoveAppCryptohomeComplete, | 
| 232                                     cryptohome_id, base::Closure())); | 240                                     cryptohome_id, base::Closure())); | 
| 233     } | 241     } | 
| 234   } | 242   } | 
| 235 | 243 | 
| 236   if (active_user_to_be_deleted) | 244   if (active_user_to_be_deleted) | 
| 237     chrome::AttemptUserExit(); | 245     chrome::AttemptUserExit(); | 
| 238 } | 246 } | 
| 239 | 247 | 
| 240 }  // namespace chromeos | 248 }  // namespace chromeos | 
| OLD | NEW | 
|---|