Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(45)

Side by Side Diff: chrome/browser/profiles/off_the_record_profile_impl.cc

Issue 9977021: Add ExtensionSytem::Get(Profile*) as a wrapper around (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/off_the_record_profile_impl.h" 5 #include "chrome/browser/profiles/off_the_record_profile_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/file_path.h" 10 #include "base/file_path.h"
11 #include "base/file_util.h" 11 #include "base/file_util.h"
12 #include "base/memory/scoped_ptr.h" 12 #include "base/memory/scoped_ptr.h"
13 #include "base/path_service.h" 13 #include "base/path_service.h"
14 #include "base/string_util.h" 14 #include "base/string_util.h"
15 #include "build/build_config.h" 15 #include "build/build_config.h"
16 #include "chrome/browser/background/background_contents_service_factory.h" 16 #include "chrome/browser/background/background_contents_service_factory.h"
17 #include "chrome/browser/browser_process.h" 17 #include "chrome/browser/browser_process.h"
18 #include "chrome/browser/chrome_plugin_service_filter.h" 18 #include "chrome/browser/chrome_plugin_service_filter.h"
19 #include "chrome/browser/content_settings/host_content_settings_map.h" 19 #include "chrome/browser/content_settings/host_content_settings_map.h"
20 #include "chrome/browser/download/download_service.h" 20 #include "chrome/browser/download/download_service.h"
21 #include "chrome/browser/download/download_service_factory.h" 21 #include "chrome/browser/download/download_service_factory.h"
22 #include "chrome/browser/extensions/api/web_request/web_request_api.h" 22 #include "chrome/browser/extensions/api/web_request/web_request_api.h"
23 #include "chrome/browser/extensions/extension_info_map.h" 23 #include "chrome/browser/extensions/extension_info_map.h"
24 #include "chrome/browser/extensions/extension_pref_store.h" 24 #include "chrome/browser/extensions/extension_pref_store.h"
25 #include "chrome/browser/extensions/extension_pref_value_map.h" 25 #include "chrome/browser/extensions/extension_pref_value_map.h"
26 #include "chrome/browser/extensions/extension_process_manager.h" 26 #include "chrome/browser/extensions/extension_process_manager.h"
27 #include "chrome/browser/extensions/extension_service.h" 27 #include "chrome/browser/extensions/extension_service.h"
28 #include "chrome/browser/extensions/extension_special_storage_policy.h" 28 #include "chrome/browser/extensions/extension_special_storage_policy.h"
29 #include "chrome/browser/extensions/extension_system.h" 29 #include "chrome/browser/extensions/extension_system.h"
30 #include "chrome/browser/extensions/extension_system_factory.h"
31 #include "chrome/browser/io_thread.h" 30 #include "chrome/browser/io_thread.h"
32 #include "chrome/browser/net/proxy_service_factory.h" 31 #include "chrome/browser/net/proxy_service_factory.h"
33 #include "chrome/browser/plugin_prefs.h" 32 #include "chrome/browser/plugin_prefs.h"
34 #include "chrome/browser/prefs/incognito_mode_prefs.h" 33 #include "chrome/browser/prefs/incognito_mode_prefs.h"
35 #include "chrome/browser/prefs/pref_service.h" 34 #include "chrome/browser/prefs/pref_service.h"
36 #include "chrome/browser/profiles/profile_dependency_manager.h" 35 #include "chrome/browser/profiles/profile_dependency_manager.h"
37 #include "chrome/browser/themes/theme_service.h" 36 #include "chrome/browser/themes/theme_service.h"
38 #include "chrome/browser/transport_security_persister.h" 37 #include "chrome/browser/transport_security_persister.h"
39 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" 38 #include "chrome/browser/ui/webui/chrome_url_data_manager.h"
40 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" 39 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h"
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 115
117 OffTheRecordProfileImpl::~OffTheRecordProfileImpl() { 116 OffTheRecordProfileImpl::~OffTheRecordProfileImpl() {
118 content::NotificationService::current()->Notify( 117 content::NotificationService::current()->Notify(
119 chrome::NOTIFICATION_PROFILE_DESTROYED, content::Source<Profile>(this), 118 chrome::NOTIFICATION_PROFILE_DESTROYED, content::Source<Profile>(this),
120 content::NotificationService::NoDetails()); 119 content::NotificationService::NoDetails());
121 120
122 ChromePluginServiceFilter::GetInstance()->UnregisterResourceContext( 121 ChromePluginServiceFilter::GetInstance()->UnregisterResourceContext(
123 io_data_.GetResourceContextNoInit()); 122 io_data_.GetResourceContextNoInit());
124 123
125 ExtensionService* extension_service = 124 ExtensionService* extension_service =
126 ExtensionSystemFactory::GetForProfile(this)->extension_service(); 125 ExtensionSystem::Get(this)->extension_service();
127 if (extension_service && extension_service->extensions_enabled()) { 126 if (extension_service && extension_service->extensions_enabled()) {
128 extension_service->extension_prefs()-> 127 extension_service->extension_prefs()->
129 ClearIncognitoSessionOnlyContentSettings(); 128 ClearIncognitoSessionOnlyContentSettings();
130 } 129 }
131 130
132 ProfileDependencyManager::GetInstance()->DestroyProfileServices(this); 131 ProfileDependencyManager::GetInstance()->DestroyProfileServices(this);
133 132
134 BrowserThread::PostTask( 133 BrowserThread::PostTask(
135 BrowserThread::IO, FROM_HERE, 134 BrowserThread::IO, FROM_HERE,
136 base::Bind(&NotifyOTRProfileDestroyedOnIOThread, profile_, this)); 135 base::Bind(&NotifyOTRProfileDestroyedOnIOThread, profile_, this));
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 // We don't provide access to the VisitedLinkMaster when we're OffTheRecord 190 // We don't provide access to the VisitedLinkMaster when we're OffTheRecord
192 // because we don't want to leak the sites that the user has visited before. 191 // because we don't want to leak the sites that the user has visited before.
193 return NULL; 192 return NULL;
194 } 193 }
195 194
196 ExtensionPrefValueMap* OffTheRecordProfileImpl::GetExtensionPrefValueMap() { 195 ExtensionPrefValueMap* OffTheRecordProfileImpl::GetExtensionPrefValueMap() {
197 return NULL; 196 return NULL;
198 } 197 }
199 198
200 ExtensionService* OffTheRecordProfileImpl::GetExtensionService() { 199 ExtensionService* OffTheRecordProfileImpl::GetExtensionService() {
201 return ExtensionSystemFactory::GetForProfile(this)->extension_service(); 200 return ExtensionSystem::Get(this)->extension_service();
202 } 201 }
203 202
204 UserScriptMaster* OffTheRecordProfileImpl::GetUserScriptMaster() { 203 UserScriptMaster* OffTheRecordProfileImpl::GetUserScriptMaster() {
205 return ExtensionSystemFactory::GetForProfile(this)->user_script_master(); 204 return ExtensionSystem::Get(this)->user_script_master();
206 } 205 }
207 206
208 ExtensionProcessManager* 207 ExtensionProcessManager*
209 OffTheRecordProfileImpl::GetExtensionProcessManager() { 208 OffTheRecordProfileImpl::GetExtensionProcessManager() {
210 return ExtensionSystemFactory::GetForProfile(this)->process_manager(); 209 return ExtensionSystem::Get(this)->process_manager();
211 } 210 }
212 211
213 ExtensionEventRouter* OffTheRecordProfileImpl::GetExtensionEventRouter() { 212 ExtensionEventRouter* OffTheRecordProfileImpl::GetExtensionEventRouter() {
214 return ExtensionSystemFactory::GetForProfile(this)->event_router(); 213 return ExtensionSystem::Get(this)->event_router();
215 } 214 }
216 215
217 ExtensionSpecialStoragePolicy* 216 ExtensionSpecialStoragePolicy*
218 OffTheRecordProfileImpl::GetExtensionSpecialStoragePolicy() { 217 OffTheRecordProfileImpl::GetExtensionSpecialStoragePolicy() {
219 return GetOriginalProfile()->GetExtensionSpecialStoragePolicy(); 218 return GetOriginalProfile()->GetExtensionSpecialStoragePolicy();
220 } 219 }
221 220
222 GAIAInfoUpdateService* OffTheRecordProfileImpl::GetGAIAInfoUpdateService() { 221 GAIAInfoUpdateService* OffTheRecordProfileImpl::GetGAIAInfoUpdateService() {
223 return NULL; 222 return NULL;
224 } 223 }
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
499 OffTheRecordProfileImpl* profile = NULL; 498 OffTheRecordProfileImpl* profile = NULL;
500 #if defined(OS_CHROMEOS) 499 #if defined(OS_CHROMEOS)
501 if (Profile::IsGuestSession()) 500 if (Profile::IsGuestSession())
502 profile = new GuestSessionProfile(this); 501 profile = new GuestSessionProfile(this);
503 #endif 502 #endif
504 if (!profile) 503 if (!profile)
505 profile = new OffTheRecordProfileImpl(this); 504 profile = new OffTheRecordProfileImpl(this);
506 profile->Init(); 505 profile->Init();
507 return profile; 506 return profile;
508 } 507 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698