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

Side by Side Diff: chrome/browser/chromeos/system_logs/debug_daemon_log_source.cc

Issue 444903002: [cros] user_manager component - move UserManagerBase and UserManager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 4 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 (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"
11 #include "base/memory/scoped_ptr.h" 11 #include "base/memory/scoped_ptr.h"
12 #include "base/memory/weak_ptr.h" 12 #include "base/memory/weak_ptr.h"
13 #include "base/strings/string_number_conversions.h" 13 #include "base/strings/string_number_conversions.h"
14 #include "base/strings/string_util.h" 14 #include "base/strings/string_util.h"
15 #include "chrome/browser/chromeos/login/users/user_manager.h"
16 #include "chrome/browser/profiles/profile_manager.h" 15 #include "chrome/browser/profiles/profile_manager.h"
17 #include "chrome/common/chrome_switches.h" 16 #include "chrome/common/chrome_switches.h"
18 #include "chromeos/dbus/dbus_thread_manager.h" 17 #include "chromeos/dbus/dbus_thread_manager.h"
19 #include "chromeos/dbus/debug_daemon_client.h" 18 #include "chromeos/dbus/debug_daemon_client.h"
19 #include "components/user_manager/user_manager.h"
20 #include "content/public/browser/browser_thread.h" 20 #include "content/public/browser/browser_thread.h"
21 21
22 const char kNotAvailable[] = "<not available>"; 22 const char kNotAvailable[] = "<not available>";
23 const char kRoutesKeyName[] = "routes"; 23 const char kRoutesKeyName[] = "routes";
24 const char kNetworkStatusKeyName[] = "network-status"; 24 const char kNetworkStatusKeyName[] = "network-status";
25 const char kModemStatusKeyName[] = "modem-status"; 25 const char kModemStatusKeyName[] = "modem-status";
26 const char kWiMaxStatusKeyName[] = "wimax-status"; 26 const char kWiMaxStatusKeyName[] = "wimax-status";
27 const char kUserLogFileKeyName[] = "user_log_files"; 27 const char kUserLogFileKeyName[] = "user_log_files";
28 28
29 namespace system_logs { 29 namespace system_logs {
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
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() && user_manager::UserManager::IsInitialized() &&
140 chromeos::UserManager::IsInitialized() && 140 user_manager::UserManager::Get()->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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698