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 "build/build_config.h" | 9 #include "build/build_config.h" |
10 #include "chrome/browser/prefs/pref_service.h" | 10 #include "chrome/browser/prefs/pref_service.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 Profile* Profile::FromBrowserContext(content::BrowserContext* browser_context) { | 32 Profile* Profile::FromBrowserContext(content::BrowserContext* browser_context) { |
33 // This is safe; this is the only implementation of the browser context. | 33 // This is safe; this is the only implementation of the browser context. |
34 return static_cast<Profile*>(browser_context); | 34 return static_cast<Profile*>(browser_context); |
35 } | 35 } |
36 | 36 |
37 // static | 37 // static |
38 Profile* Profile::FromWebUI(content::WebUI* web_ui) { | 38 Profile* Profile::FromWebUI(content::WebUI* web_ui) { |
39 return FromBrowserContext(web_ui->GetWebContents()->GetBrowserContext()); | 39 return FromBrowserContext(web_ui->GetWebContents()->GetBrowserContext()); |
40 } | 40 } |
41 | 41 |
| 42 bool Profile::ShouldSaveSessionStorageOnDisk() { |
| 43 return false; |
| 44 } |
| 45 |
42 TestingProfile* Profile::AsTestingProfile() { | 46 TestingProfile* Profile::AsTestingProfile() { |
43 return NULL; | 47 return NULL; |
44 } | 48 } |
45 | 49 |
46 // static | 50 // static |
47 const char* const Profile::kProfileKey = "__PROFILE__"; | 51 const char* const Profile::kProfileKey = "__PROFILE__"; |
48 | 52 |
49 // static | 53 // static |
50 void Profile::RegisterUserPrefs(PrefService* prefs) { | 54 void Profile::RegisterUserPrefs(PrefService* prefs) { |
51 prefs->RegisterBooleanPref(prefs::kSearchSuggestEnabled, | 55 prefs->RegisterBooleanPref(prefs::kSearchSuggestEnabled, |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 return is_guest_session; | 125 return is_guest_session; |
122 #else | 126 #else |
123 return false; | 127 return false; |
124 #endif | 128 #endif |
125 } | 129 } |
126 | 130 |
127 bool Profile::IsSyncAccessible() { | 131 bool Profile::IsSyncAccessible() { |
128 browser_sync::SyncPrefs prefs(GetPrefs()); | 132 browser_sync::SyncPrefs prefs(GetPrefs()); |
129 return ProfileSyncService::IsSyncEnabled() && !prefs.IsManaged(); | 133 return ProfileSyncService::IsSyncEnabled() && !prefs.IsManaged(); |
130 } | 134 } |
OLD | NEW |