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/off_the_record_profile_impl.h" | 5 #include "chrome/browser/profiles/off_the_record_profile_impl.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 #include "components/zoom/zoom_event_manager.h" | 52 #include "components/zoom/zoom_event_manager.h" |
53 #include "content/public/browser/browser_thread.h" | 53 #include "content/public/browser/browser_thread.h" |
54 #include "content/public/browser/host_zoom_map.h" | 54 #include "content/public/browser/host_zoom_map.h" |
55 #include "content/public/browser/render_process_host.h" | 55 #include "content/public/browser/render_process_host.h" |
56 #include "content/public/browser/storage_partition.h" | 56 #include "content/public/browser/storage_partition.h" |
57 #include "content/public/browser/url_data_source.h" | 57 #include "content/public/browser/url_data_source.h" |
58 #include "content/public/browser/web_contents.h" | 58 #include "content/public/browser/web_contents.h" |
59 #include "extensions/features/features.h" | 59 #include "extensions/features/features.h" |
60 #include "net/http/http_server_properties.h" | 60 #include "net/http/http_server_properties.h" |
61 #include "net/http/transport_security_state.h" | 61 #include "net/http/transport_security_state.h" |
| 62 #include "ppapi/features/features.h" |
62 #include "storage/browser/database/database_tracker.h" | 63 #include "storage/browser/database/database_tracker.h" |
63 | 64 |
64 #if defined(OS_ANDROID) | 65 #if defined(OS_ANDROID) |
65 #include "components/prefs/scoped_user_pref_update.h" | 66 #include "components/prefs/scoped_user_pref_update.h" |
66 #include "components/proxy_config/proxy_prefs.h" | 67 #include "components/proxy_config/proxy_prefs.h" |
67 #endif // defined(OS_ANDROID) | 68 #endif // defined(OS_ANDROID) |
68 | 69 |
69 #if defined(OS_CHROMEOS) | 70 #if defined(OS_CHROMEOS) |
70 #include "chrome/browser/chromeos/preferences.h" | 71 #include "chrome/browser/chromeos/preferences.h" |
71 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 72 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 set_is_guest_profile( | 143 set_is_guest_profile( |
143 profile_->GetPath() == ProfileManager::GetGuestProfilePath()); | 144 profile_->GetPath() == ProfileManager::GetGuestProfilePath()); |
144 | 145 |
145 // Guest profiles may always be OTR. Check IncognitoModePrefs otherwise. | 146 // Guest profiles may always be OTR. Check IncognitoModePrefs otherwise. |
146 DCHECK(profile_->IsGuestSession() || | 147 DCHECK(profile_->IsGuestSession() || |
147 IncognitoModePrefs::GetAvailability(profile_->GetPrefs()) != | 148 IncognitoModePrefs::GetAvailability(profile_->GetPrefs()) != |
148 IncognitoModePrefs::DISABLED); | 149 IncognitoModePrefs::DISABLED); |
149 | 150 |
150 TrackZoomLevelsFromParent(); | 151 TrackZoomLevelsFromParent(); |
151 | 152 |
152 #if defined(ENABLE_PLUGINS) | 153 #if BUILDFLAG(ENABLE_PLUGINS) |
153 ChromePluginServiceFilter::GetInstance()->RegisterResourceContext( | 154 ChromePluginServiceFilter::GetInstance()->RegisterResourceContext( |
154 this, io_data_->GetResourceContextNoInit()); | 155 this, io_data_->GetResourceContextNoInit()); |
155 #endif | 156 #endif |
156 | 157 |
157 #if BUILDFLAG(ENABLE_EXTENSIONS) | 158 #if BUILDFLAG(ENABLE_EXTENSIONS) |
158 // Make the chrome//extension-icon/ resource available. | 159 // Make the chrome//extension-icon/ resource available. |
159 extensions::ExtensionIconSource* icon_source = | 160 extensions::ExtensionIconSource* icon_source = |
160 new extensions::ExtensionIconSource(profile_); | 161 new extensions::ExtensionIconSource(profile_); |
161 content::URLDataSource::Add(this, icon_source); | 162 content::URLDataSource::Add(this, icon_source); |
162 | 163 |
163 BrowserThread::PostTask( | 164 BrowserThread::PostTask( |
164 BrowserThread::IO, FROM_HERE, | 165 BrowserThread::IO, FROM_HERE, |
165 base::Bind(&NotifyOTRProfileCreatedOnIOThread, profile_, this)); | 166 base::Bind(&NotifyOTRProfileCreatedOnIOThread, profile_, this)); |
166 #endif | 167 #endif |
167 | 168 |
168 // The DomDistillerViewerSource is not a normal WebUI so it must be registered | 169 // The DomDistillerViewerSource is not a normal WebUI so it must be registered |
169 // as a URLDataSource early. | 170 // as a URLDataSource early. |
170 dom_distiller::RegisterViewerSource(this); | 171 dom_distiller::RegisterViewerSource(this); |
171 } | 172 } |
172 | 173 |
173 OffTheRecordProfileImpl::~OffTheRecordProfileImpl() { | 174 OffTheRecordProfileImpl::~OffTheRecordProfileImpl() { |
174 MaybeSendDestroyedNotification(); | 175 MaybeSendDestroyedNotification(); |
175 | 176 |
176 #if defined(ENABLE_PLUGINS) | 177 #if BUILDFLAG(ENABLE_PLUGINS) |
177 ChromePluginServiceFilter::GetInstance()->UnregisterResourceContext( | 178 ChromePluginServiceFilter::GetInstance()->UnregisterResourceContext( |
178 io_data_->GetResourceContextNoInit()); | 179 io_data_->GetResourceContextNoInit()); |
179 #endif | 180 #endif |
180 | 181 |
181 BrowserContextDependencyManager::GetInstance()->DestroyBrowserContextServices( | 182 BrowserContextDependencyManager::GetInstance()->DestroyBrowserContextServices( |
182 this); | 183 this); |
183 | 184 |
184 #if BUILDFLAG(ENABLE_EXTENSIONS) | 185 #if BUILDFLAG(ENABLE_EXTENSIONS) |
185 BrowserThread::PostTask( | 186 BrowserThread::PostTask( |
186 BrowserThread::IO, FROM_HERE, | 187 BrowserThread::IO, FROM_HERE, |
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
553 PrefProxyConfigTracker* OffTheRecordProfileImpl::CreateProxyConfigTracker() { | 554 PrefProxyConfigTracker* OffTheRecordProfileImpl::CreateProxyConfigTracker() { |
554 #if defined(OS_CHROMEOS) | 555 #if defined(OS_CHROMEOS) |
555 if (chromeos::ProfileHelper::IsSigninProfile(this)) { | 556 if (chromeos::ProfileHelper::IsSigninProfile(this)) { |
556 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState( | 557 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState( |
557 g_browser_process->local_state()); | 558 g_browser_process->local_state()); |
558 } | 559 } |
559 #endif // defined(OS_CHROMEOS) | 560 #endif // defined(OS_CHROMEOS) |
560 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfProfile( | 561 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfProfile( |
561 GetPrefs(), g_browser_process->local_state()); | 562 GetPrefs(), g_browser_process->local_state()); |
562 } | 563 } |
OLD | NEW |