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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 #include "chrome/common/extensions/extension.h" | 42 #include "chrome/common/extensions/extension.h" |
43 #include "chrome/common/json_pref_store.h" | 43 #include "chrome/common/json_pref_store.h" |
44 #include "chrome/common/pref_names.h" | 44 #include "chrome/common/pref_names.h" |
45 #include "chrome/common/render_messages.h" | 45 #include "chrome/common/render_messages.h" |
46 #include "content/browser/appcache/chrome_appcache_service.h" | 46 #include "content/browser/appcache/chrome_appcache_service.h" |
47 #include "content/browser/chrome_blob_storage_context.h" | 47 #include "content/browser/chrome_blob_storage_context.h" |
48 #include "content/browser/file_system/browser_file_system_helper.h" | 48 #include "content/browser/file_system/browser_file_system_helper.h" |
49 #include "content/browser/host_zoom_map.h" | 49 #include "content/browser/host_zoom_map.h" |
50 #include "content/browser/in_process_webkit/webkit_context.h" | 50 #include "content/browser/in_process_webkit/webkit_context.h" |
51 #include "content/browser/ssl/ssl_host_state.h" | 51 #include "content/browser/ssl/ssl_host_state.h" |
52 #include "content/browser/tab_contents/tab_contents.h" | |
53 #include "content/browser/webui/web_ui.h" | 52 #include "content/browser/webui/web_ui.h" |
54 #include "content/public/browser/browser_thread.h" | 53 #include "content/public/browser/browser_thread.h" |
55 #include "content/public/browser/download_manager.h" | 54 #include "content/public/browser/download_manager.h" |
| 55 #include "content/public/browser/web_contents.h" |
56 #include "grit/locale_settings.h" | 56 #include "grit/locale_settings.h" |
57 #include "ui/base/resource/resource_bundle.h" | 57 #include "ui/base/resource/resource_bundle.h" |
58 #include "webkit/database/database_tracker.h" | 58 #include "webkit/database/database_tracker.h" |
59 #include "webkit/quota/quota_manager.h" | 59 #include "webkit/quota/quota_manager.h" |
60 | 60 |
61 #if defined(TOOLKIT_USES_GTK) | 61 #if defined(TOOLKIT_USES_GTK) |
62 #include "chrome/browser/ui/gtk/gtk_theme_service.h" | 62 #include "chrome/browser/ui/gtk/gtk_theme_service.h" |
63 #endif | 63 #endif |
64 | 64 |
65 using base::Time; | 65 using base::Time; |
(...skipping 15 matching lines...) Expand all Loading... |
81 // static | 81 // static |
82 Profile* Profile::FromBrowserContext(content::BrowserContext* browser_context) { | 82 Profile* Profile::FromBrowserContext(content::BrowserContext* browser_context) { |
83 // This is safe; this is the only implementation of the browser context. | 83 // This is safe; this is the only implementation of the browser context. |
84 return static_cast<Profile*>(browser_context); | 84 return static_cast<Profile*>(browser_context); |
85 } | 85 } |
86 | 86 |
87 // static | 87 // static |
88 Profile* Profile::FromWebUI(WebUI* web_ui) { | 88 Profile* Profile::FromWebUI(WebUI* web_ui) { |
89 // TODO(dhollowa): Crash diagnosis http://crbug.com/97802 | 89 // TODO(dhollowa): Crash diagnosis http://crbug.com/97802 |
90 CHECK(web_ui); | 90 CHECK(web_ui); |
91 CHECK(web_ui->tab_contents()); | 91 CHECK(web_ui->web_contents()); |
92 CHECK(web_ui->tab_contents()->GetBrowserContext()); | 92 CHECK(web_ui->web_contents()->GetBrowserContext()); |
93 | 93 |
94 return FromBrowserContext(web_ui->tab_contents()->GetBrowserContext()); | 94 return FromBrowserContext(web_ui->web_contents()->GetBrowserContext()); |
95 } | 95 } |
96 | 96 |
97 TestingProfile* Profile::AsTestingProfile() { | 97 TestingProfile* Profile::AsTestingProfile() { |
98 return NULL; | 98 return NULL; |
99 } | 99 } |
100 | 100 |
101 // static | 101 // static |
102 const char* const Profile::kProfileKey = "__PROFILE__"; | 102 const char* const Profile::kProfileKey = "__PROFILE__"; |
103 | 103 |
104 #if !defined(OS_MACOSX) && !defined(OS_CHROMEOS) && defined(OS_POSIX) | 104 #if !defined(OS_MACOSX) && !defined(OS_CHROMEOS) && defined(OS_POSIX) |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 return is_guest_session; | 214 return is_guest_session; |
215 #else | 215 #else |
216 return false; | 216 return false; |
217 #endif | 217 #endif |
218 } | 218 } |
219 | 219 |
220 bool Profile::IsSyncAccessible() { | 220 bool Profile::IsSyncAccessible() { |
221 ProfileSyncService* syncService = GetProfileSyncService(); | 221 ProfileSyncService* syncService = GetProfileSyncService(); |
222 return syncService && !syncService->IsManaged(); | 222 return syncService && !syncService->IsManaged(); |
223 } | 223 } |
OLD | NEW |