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

Side by Side Diff: chrome/browser/chromeos/app_mode/kiosk_profile_loader.cc

Issue 205713002: Add a basic demo mode browser test. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix license Created 6 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 | Annotate | Revision Log
OLDNEW
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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 int retry_count_; 110 int retry_count_;
111 111
112 DISALLOW_COPY_AND_ASSIGN(CryptohomedChecker); 112 DISALLOW_COPY_AND_ASSIGN(CryptohomedChecker);
113 }; 113 };
114 114
115 115
116 //////////////////////////////////////////////////////////////////////////////// 116 ////////////////////////////////////////////////////////////////////////////////
117 // KioskProfileLoader 117 // KioskProfileLoader
118 118
119 KioskProfileLoader::KioskProfileLoader(const std::string& app_user_id, 119 KioskProfileLoader::KioskProfileLoader(const std::string& app_user_id,
120 bool force_ephemeral, 120 bool use_guest_mount,
121 Delegate* delegate) 121 Delegate* delegate)
122 : user_id_(app_user_id), 122 : user_id_(app_user_id),
123 force_ephemeral_(force_ephemeral), 123 use_guest_mount_(use_guest_mount),
124 delegate_(delegate) {} 124 delegate_(delegate) {}
125 125
126 KioskProfileLoader::~KioskProfileLoader() {} 126 KioskProfileLoader::~KioskProfileLoader() {}
127 127
128 void KioskProfileLoader::Start() { 128 void KioskProfileLoader::Start() {
129 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 129 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
130 login_performer_.reset(); 130 login_performer_.reset();
131 cryptohomed_checker_.reset(new CryptohomedChecker(this)); 131 cryptohomed_checker_.reset(new CryptohomedChecker(this));
132 cryptohomed_checker_->StartCheck(); 132 cryptohomed_checker_->StartCheck();
133 } 133 }
134 134
135 void KioskProfileLoader::LoginAsKioskAccount() { 135 void KioskProfileLoader::LoginAsKioskAccount() {
136 login_performer_.reset(new LoginPerformer(this)); 136 login_performer_.reset(new LoginPerformer(this));
137 login_performer_->LoginAsKioskAccount(user_id_, force_ephemeral_); 137 login_performer_->LoginAsKioskAccount(user_id_, use_guest_mount_);
138 } 138 }
139 139
140 void KioskProfileLoader::ReportLaunchResult(KioskAppLaunchError::Error error) { 140 void KioskProfileLoader::ReportLaunchResult(KioskAppLaunchError::Error error) {
141 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 141 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
142 142
143 if (error != KioskAppLaunchError::NONE) { 143 if (error != KioskAppLaunchError::NONE) {
144 delegate_->OnProfileLoadFailed(error); 144 delegate_->OnProfileLoadFailed(error);
145 } 145 }
146 } 146 }
147 147
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 void KioskProfileLoader::OnProfilePrepared(Profile* profile) { 185 void KioskProfileLoader::OnProfilePrepared(Profile* profile) {
186 // This object could be deleted any time after successfully reporting 186 // This object could be deleted any time after successfully reporting
187 // a profile load, so invalidate the LoginUtils delegate now. 187 // a profile load, so invalidate the LoginUtils delegate now.
188 LoginUtils::Get()->DelegateDeleted(this); 188 LoginUtils::Get()->DelegateDeleted(this);
189 189
190 delegate_->OnProfileLoaded(profile); 190 delegate_->OnProfileLoaded(profile);
191 ReportLaunchResult(KioskAppLaunchError::NONE); 191 ReportLaunchResult(KioskAppLaunchError::NONE);
192 } 192 }
193 193
194 } // namespace chromeos 194 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/app_mode/kiosk_profile_loader.h ('k') | chrome/browser/chromeos/idle_detector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698