OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/kiosk_profile_loader.h" | 5 #include "chrome/browser/chromeos/app_mode/kiosk_profile_loader.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 KioskProfileLoader* loader_; | 108 KioskProfileLoader* loader_; |
109 int retry_count_; | 109 int retry_count_; |
110 | 110 |
111 DISALLOW_COPY_AND_ASSIGN(CryptohomedChecker); | 111 DISALLOW_COPY_AND_ASSIGN(CryptohomedChecker); |
112 }; | 112 }; |
113 | 113 |
114 | 114 |
115 //////////////////////////////////////////////////////////////////////////////// | 115 //////////////////////////////////////////////////////////////////////////////// |
116 // KioskProfileLoader | 116 // KioskProfileLoader |
117 | 117 |
118 KioskProfileLoader::KioskProfileLoader(KioskAppManager* kiosk_app_manager, | 118 KioskProfileLoader::KioskProfileLoader(const std::string& app_user_id, |
119 const std::string& app_id, | |
120 Delegate* delegate) | 119 Delegate* delegate) |
121 : kiosk_app_manager_(kiosk_app_manager), | 120 : user_id_(app_user_id), delegate_(delegate) {} |
122 app_id_(app_id), | |
123 delegate_(delegate) { | |
124 KioskAppManager::App app; | |
125 CHECK(kiosk_app_manager_->GetApp(app_id_, &app)); | |
126 user_id_ = app.user_id; | |
127 } | |
128 | 121 |
129 KioskProfileLoader::~KioskProfileLoader() {} | 122 KioskProfileLoader::~KioskProfileLoader() {} |
130 | 123 |
131 void KioskProfileLoader::Start() { | 124 void KioskProfileLoader::Start() { |
132 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 125 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
133 login_performer_.reset(); | 126 login_performer_.reset(); |
134 cryptohomed_checker_.reset(new CryptohomedChecker(this)); | 127 cryptohomed_checker_.reset(new CryptohomedChecker(this)); |
135 cryptohomed_checker_->StartCheck(); | 128 cryptohomed_checker_->StartCheck(); |
136 } | 129 } |
137 | 130 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 void KioskProfileLoader::OnProfilePrepared(Profile* profile) { | 173 void KioskProfileLoader::OnProfilePrepared(Profile* profile) { |
181 // This object could be deleted any time after successfully reporting | 174 // This object could be deleted any time after successfully reporting |
182 // a profile load, so invalidate the LoginUtils delegate now. | 175 // a profile load, so invalidate the LoginUtils delegate now. |
183 LoginUtils::Get()->DelegateDeleted(this); | 176 LoginUtils::Get()->DelegateDeleted(this); |
184 | 177 |
185 delegate_->OnProfileLoaded(profile); | 178 delegate_->OnProfileLoaded(profile); |
186 ReportLaunchResult(KioskAppLaunchError::NONE); | 179 ReportLaunchResult(KioskAppLaunchError::NONE); |
187 } | 180 } |
188 | 181 |
189 } // namespace chromeos | 182 } // namespace chromeos |
OLD | NEW |