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

Side by Side Diff: chrome/browser/chromeos/app_mode/arc/arc_kiosk_app_manager.cc

Issue 2496903003: arc: Add Arc Kiosk app service and ability to launch kiosk apps. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@policy_comp_parse
Patch Set: rebase Created 4 years, 1 month 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/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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698