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

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

Issue 10824020: Move PROFILE_DESTROYED notification to ProfileDestroyer and observe it in ExtensionProcessManager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: destroy original profile->destroy incognito EPM Created 8 years, 5 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"
(...skipping 19 matching lines...) Expand all
30 #include "chrome/browser/io_thread.h" 30 #include "chrome/browser/io_thread.h"
31 #include "chrome/browser/net/proxy_service_factory.h" 31 #include "chrome/browser/net/proxy_service_factory.h"
32 #include "chrome/browser/plugin_prefs.h" 32 #include "chrome/browser/plugin_prefs.h"
33 #include "chrome/browser/prefs/incognito_mode_prefs.h" 33 #include "chrome/browser/prefs/incognito_mode_prefs.h"
34 #include "chrome/browser/prefs/pref_service.h" 34 #include "chrome/browser/prefs/pref_service.h"
35 #include "chrome/browser/profiles/profile_dependency_manager.h" 35 #include "chrome/browser/profiles/profile_dependency_manager.h"
36 #include "chrome/browser/themes/theme_service.h" 36 #include "chrome/browser/themes/theme_service.h"
37 #include "chrome/browser/ui/webui/chrome_url_data_manager_factory.h" 37 #include "chrome/browser/ui/webui/chrome_url_data_manager_factory.h"
38 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" 38 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h"
39 #include "chrome/common/chrome_constants.h" 39 #include "chrome/common/chrome_constants.h"
40 #include "chrome/common/chrome_notification_types.h"
41 #include "chrome/common/chrome_paths.h" 40 #include "chrome/common/chrome_paths.h"
42 #include "chrome/common/chrome_switches.h" 41 #include "chrome/common/chrome_switches.h"
43 #include "chrome/common/extensions/extension.h" 42 #include "chrome/common/extensions/extension.h"
44 #include "chrome/common/json_pref_store.h" 43 #include "chrome/common/json_pref_store.h"
45 #include "chrome/common/pref_names.h" 44 #include "chrome/common/pref_names.h"
46 #include "chrome/common/render_messages.h" 45 #include "chrome/common/render_messages.h"
47 #include "content/public/browser/browser_thread.h" 46 #include "content/public/browser/browser_thread.h"
48 #include "content/public/browser/host_zoom_map.h" 47 #include "content/public/browser/host_zoom_map.h"
49 #include "content/public/browser/notification_service.h" 48 #include "content/public/browser/notification_service.h"
49 #include "content/public/browser/notification_types.h"
50 #include "content/public/browser/render_process_host.h" 50 #include "content/public/browser/render_process_host.h"
51 #include "content/public/browser/web_contents.h" 51 #include "content/public/browser/web_contents.h"
52 #include "net/base/transport_security_state.h" 52 #include "net/base/transport_security_state.h"
53 #include "net/http/http_server_properties.h" 53 #include "net/http/http_server_properties.h"
54 #include "webkit/database/database_tracker.h" 54 #include "webkit/database/database_tracker.h"
55 55
56 #if defined(OS_CHROMEOS) 56 #if defined(OS_CHROMEOS)
57 #include "chrome/browser/chromeos/preferences.h" 57 #include "chrome/browser/chromeos/preferences.h"
58 #include "chrome/browser/chromeos/proxy_config_service_impl.h" 58 #include "chrome/browser/chromeos/proxy_config_service_impl.h"
59 #endif 59 #endif
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 107
108 ChromePluginServiceFilter::GetInstance()->RegisterResourceContext( 108 ChromePluginServiceFilter::GetInstance()->RegisterResourceContext(
109 PluginPrefs::GetForProfile(this), io_data_.GetResourceContextNoInit()); 109 PluginPrefs::GetForProfile(this), io_data_.GetResourceContextNoInit());
110 110
111 BrowserThread::PostTask( 111 BrowserThread::PostTask(
112 BrowserThread::IO, FROM_HERE, 112 BrowserThread::IO, FROM_HERE,
113 base::Bind(&NotifyOTRProfileCreatedOnIOThread, profile_, this)); 113 base::Bind(&NotifyOTRProfileCreatedOnIOThread, profile_, this));
114 } 114 }
115 115
116 OffTheRecordProfileImpl::~OffTheRecordProfileImpl() { 116 OffTheRecordProfileImpl::~OffTheRecordProfileImpl() {
117 content::NotificationService::current()->Notify( 117 MaybeSendDestroyedNotification();
118 chrome::NOTIFICATION_PROFILE_DESTROYED, content::Source<Profile>(this),
119 content::NotificationService::NoDetails());
120 118
121 ChromePluginServiceFilter::GetInstance()->UnregisterResourceContext( 119 ChromePluginServiceFilter::GetInstance()->UnregisterResourceContext(
122 io_data_.GetResourceContextNoInit()); 120 io_data_.GetResourceContextNoInit());
123 121
124 ExtensionService* extension_service = 122 ExtensionService* extension_service =
125 extensions::ExtensionSystem::Get(this)->extension_service(); 123 extensions::ExtensionSystem::Get(this)->extension_service();
126 if (extension_service && extension_service->extensions_enabled()) { 124 if (extension_service && extension_service->extensions_enabled()) {
127 extension_service->extension_prefs()-> 125 extension_service->extension_prefs()->
128 ClearIncognitoSessionOnlyContentSettings(); 126 ClearIncognitoSessionOnlyContentSettings();
129 } 127 }
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
481 if (!profile) 479 if (!profile)
482 profile = new OffTheRecordProfileImpl(this); 480 profile = new OffTheRecordProfileImpl(this);
483 profile->Init(); 481 profile->Init();
484 return profile; 482 return profile;
485 } 483 }
486 484
487 base::Callback<ChromeURLDataManagerBackend*(void)> 485 base::Callback<ChromeURLDataManagerBackend*(void)>
488 OffTheRecordProfileImpl::GetChromeURLDataManagerBackendGetter() const { 486 OffTheRecordProfileImpl::GetChromeURLDataManagerBackendGetter() const {
489 return io_data_.GetChromeURLDataManagerBackendGetter(); 487 return io_data_.GetChromeURLDataManagerBackendGetter();
490 } 488 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698