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/profiles/profile.h" | 5 #include "chrome/browser/profiles/profile.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 std::string Profile::GetDebugName() { | 198 std::string Profile::GetDebugName() { |
199 std::string name = GetPath().BaseName().MaybeAsASCII(); | 199 std::string name = GetPath().BaseName().MaybeAsASCII(); |
200 if (name.empty()) { | 200 if (name.empty()) { |
201 name = "UnknownProfile"; | 201 name = "UnknownProfile"; |
202 } | 202 } |
203 return name; | 203 return name; |
204 } | 204 } |
205 | 205 |
206 bool Profile::IsGuestSession() const { | 206 bool Profile::IsGuestSession() const { |
207 #if defined(OS_CHROMEOS) | 207 #if defined(OS_CHROMEOS) |
208 static bool is_guest_session = CommandLine::ForCurrentProcess()->HasSwitch( | 208 static bool is_guest_session = |
209 chromeos::switches::kGuestSession); | 209 base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 210 chromeos::switches::kGuestSession); |
210 return is_guest_session; | 211 return is_guest_session; |
211 #else | 212 #else |
212 return GetPath() == ProfileManager::GetGuestProfilePath(); | 213 return GetPath() == ProfileManager::GetGuestProfilePath(); |
213 #endif | 214 #endif |
214 } | 215 } |
215 | 216 |
216 bool Profile::IsNewProfile() { | 217 bool Profile::IsNewProfile() { |
217 // The profile has been shut down if the prefs were loaded from disk, unless | 218 // The profile has been shut down if the prefs were loaded from disk, unless |
218 // first-run autoimport wrote them and reloaded the pref service. | 219 // first-run autoimport wrote them and reloaded the pref service. |
219 // TODO(dconnelly): revisit this when crbug.com/22142 (unifying the profile | 220 // TODO(dconnelly): revisit this when crbug.com/22142 (unifying the profile |
(...skipping 29 matching lines...) Expand all Loading... |
249 if (a->IsSameProfile(b)) | 250 if (a->IsSameProfile(b)) |
250 return false; | 251 return false; |
251 return a->GetOriginalProfile() < b->GetOriginalProfile(); | 252 return a->GetOriginalProfile() < b->GetOriginalProfile(); |
252 } | 253 } |
253 | 254 |
254 double Profile::GetDefaultZoomLevelForProfile() { | 255 double Profile::GetDefaultZoomLevelForProfile() { |
255 return GetDefaultStoragePartition(this) | 256 return GetDefaultStoragePartition(this) |
256 ->GetHostZoomMap() | 257 ->GetHostZoomMap() |
257 ->GetDefaultZoomLevel(); | 258 ->GetDefaultZoomLevel(); |
258 } | 259 } |
OLD | NEW |