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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 } // namespace | 93 } // namespace |
94 | 94 |
95 Profile::Profile() | 95 Profile::Profile() |
96 : restored_last_session_(false), | 96 : restored_last_session_(false), |
97 first_launched_(g_first_profile_launched), | 97 first_launched_(g_first_profile_launched), |
98 accessibility_pause_level_(0) { | 98 accessibility_pause_level_(0) { |
99 g_first_profile_launched = false; | 99 g_first_profile_launched = false; |
100 } | 100 } |
101 | 101 |
102 // static | 102 // static |
| 103 Profile* Profile::FromBrowserContext(content::BrowserContext* browser_context) { |
| 104 // This is safe; this is the only implementation of the browser context. |
| 105 return static_cast<Profile*>(browser_context); |
| 106 } |
| 107 |
| 108 // static |
103 const char* const Profile::kProfileKey = "__PROFILE__"; | 109 const char* const Profile::kProfileKey = "__PROFILE__"; |
104 | 110 |
105 #if !defined(OS_MACOSX) && !defined(OS_CHROMEOS) && defined(OS_POSIX) | 111 #if !defined(OS_MACOSX) && !defined(OS_CHROMEOS) && defined(OS_POSIX) |
106 // static | 112 // static |
107 const LocalProfileId Profile::kInvalidLocalProfileId = | 113 const LocalProfileId Profile::kInvalidLocalProfileId = |
108 static_cast<LocalProfileId>(0); | 114 static_cast<LocalProfileId>(0); |
109 #endif | 115 #endif |
110 | 116 |
111 // static | 117 // static |
112 void Profile::RegisterUserPrefs(PrefService* prefs) { | 118 void Profile::RegisterUserPrefs(PrefService* prefs) { |
(...skipping 738 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
851 }; | 857 }; |
852 #endif | 858 #endif |
853 | 859 |
854 Profile* Profile::CreateOffTheRecordProfile() { | 860 Profile* Profile::CreateOffTheRecordProfile() { |
855 #if defined(OS_CHROMEOS) | 861 #if defined(OS_CHROMEOS) |
856 if (Profile::IsGuestSession()) | 862 if (Profile::IsGuestSession()) |
857 return new GuestSessionProfile(this); | 863 return new GuestSessionProfile(this); |
858 #endif | 864 #endif |
859 return new OffTheRecordProfileImpl(this); | 865 return new OffTheRecordProfileImpl(this); |
860 } | 866 } |
OLD | NEW |