| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/system_logs/debug_daemon_log_source.h" | 5 #include "chrome/browser/chromeos/system_logs/debug_daemon_log_source.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 } | 129 } |
| 130 | 130 |
| 131 void DebugDaemonLogSource::OnGetUserLogFiles( | 131 void DebugDaemonLogSource::OnGetUserLogFiles( |
| 132 bool succeeded, | 132 bool succeeded, |
| 133 const KeyValueMap& user_log_files) { | 133 const KeyValueMap& user_log_files) { |
| 134 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); | 134 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); |
| 135 if (succeeded) { | 135 if (succeeded) { |
| 136 SystemLogsResponse* response = new SystemLogsResponse; | 136 SystemLogsResponse* response = new SystemLogsResponse; |
| 137 std::vector<Profile*> last_used = ProfileManager::GetLastOpenedProfiles(); | 137 std::vector<Profile*> last_used = ProfileManager::GetLastOpenedProfiles(); |
| 138 | 138 |
| 139 if (last_used.empty() && | 139 if (last_used.empty() && chromeos::UserManager::IsInitialized() && |
| 140 chromeos::UserManager::IsInitialized() && | 140 chromeos::GetUserManager()->IsLoggedInAsKioskApp()) { |
| 141 chromeos::UserManager::Get()->IsLoggedInAsKioskApp()) { | |
| 142 // Use the kiosk app profile explicitly because kiosk session does not | 141 // Use the kiosk app profile explicitly because kiosk session does not |
| 143 // open any browsers thus ProfileManager::GetLastOpenedProfiles returns | 142 // open any browsers thus ProfileManager::GetLastOpenedProfiles returns |
| 144 // an empty |last_used|. | 143 // an empty |last_used|. |
| 145 last_used.push_back(ProfileManager::GetActiveUserProfile()); | 144 last_used.push_back(ProfileManager::GetActiveUserProfile()); |
| 146 } | 145 } |
| 147 | 146 |
| 148 content::BrowserThread::PostBlockingPoolTaskAndReply( | 147 content::BrowserThread::PostBlockingPoolTaskAndReply( |
| 149 FROM_HERE, | 148 FROM_HERE, |
| 150 base::Bind(&DebugDaemonLogSource::ReadUserLogFiles, | 149 base::Bind(&DebugDaemonLogSource::ReadUserLogFiles, |
| 151 user_log_files, last_used, response), | 150 user_log_files, last_used, response), |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); | 193 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); |
| 195 DCHECK(!callback_.is_null()); | 194 DCHECK(!callback_.is_null()); |
| 196 | 195 |
| 197 --num_pending_requests_; | 196 --num_pending_requests_; |
| 198 if (num_pending_requests_ > 0) | 197 if (num_pending_requests_ > 0) |
| 199 return; | 198 return; |
| 200 callback_.Run(response_.get()); | 199 callback_.Run(response_.get()); |
| 201 } | 200 } |
| 202 | 201 |
| 203 } // namespace system_logs | 202 } // namespace system_logs |
| OLD | NEW |