OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 "", | 164 "", |
165 PrefService::UNSYNCABLE_PREF); | 165 PrefService::UNSYNCABLE_PREF); |
166 #endif | 166 #endif |
167 } | 167 } |
168 | 168 |
169 // static | 169 // static |
170 net::URLRequestContextGetter* Profile::GetDefaultRequestContext() { | 170 net::URLRequestContextGetter* Profile::GetDefaultRequestContext() { |
171 return default_request_context_; | 171 return default_request_context_; |
172 } | 172 } |
173 | 173 |
| 174 std::string Profile::GetDebugName() { |
| 175 std::string name = GetPath().BaseName().MaybeAsASCII(); |
| 176 if (name.empty()) { |
| 177 name = "UnknownProfile"; |
| 178 } |
| 179 return name; |
| 180 } |
| 181 |
174 bool Profile::IsGuestSession() { | 182 bool Profile::IsGuestSession() { |
175 #if defined(OS_CHROMEOS) | 183 #if defined(OS_CHROMEOS) |
176 static bool is_guest_session = | 184 static bool is_guest_session = |
177 CommandLine::ForCurrentProcess()->HasSwitch(switches::kGuestSession); | 185 CommandLine::ForCurrentProcess()->HasSwitch(switches::kGuestSession); |
178 return is_guest_session; | 186 return is_guest_session; |
179 #else | 187 #else |
180 return false; | 188 return false; |
181 #endif | 189 #endif |
182 } | 190 } |
183 | 191 |
(...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
819 }; | 827 }; |
820 #endif | 828 #endif |
821 | 829 |
822 Profile* Profile::CreateOffTheRecordProfile() { | 830 Profile* Profile::CreateOffTheRecordProfile() { |
823 #if defined(OS_CHROMEOS) | 831 #if defined(OS_CHROMEOS) |
824 if (Profile::IsGuestSession()) | 832 if (Profile::IsGuestSession()) |
825 return new GuestSessionProfile(this); | 833 return new GuestSessionProfile(this); |
826 #endif | 834 #endif |
827 return new OffTheRecordProfileImpl(this); | 835 return new OffTheRecordProfileImpl(this); |
828 } | 836 } |
OLD | NEW |