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 "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/files/file_path.h" | 10 #include "base/files/file_path.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "base/prefs/json_pref_store.h" | 12 #include "base/prefs/json_pref_store.h" |
13 #include "base/strings/string_number_conversions.h" | 13 #include "base/strings/string_number_conversions.h" |
14 #include "base/strings/string_util.h" | 14 #include "base/strings/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/dom_distiller/profile_utils.h" | 18 #include "chrome/browser/dom_distiller/profile_utils.h" |
19 #include "chrome/browser/download/chrome_download_manager_delegate.h" | 19 #include "chrome/browser/download/chrome_download_manager_delegate.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/io_thread.h" | 22 #include "chrome/browser/io_thread.h" |
23 #include "chrome/browser/net/chrome_url_request_context_getter.h" | 23 #include "chrome/browser/net/chrome_url_request_context_getter.h" |
24 #include "chrome/browser/net/pref_proxy_config_tracker.h" | 24 #include "chrome/browser/net/pref_proxy_config_tracker.h" |
25 #include "chrome/browser/net/proxy_service_factory.h" | 25 #include "chrome/browser/net/proxy_service_factory.h" |
26 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_configurator.
h" | |
27 #include "chrome/browser/plugins/chrome_plugin_service_filter.h" | 26 #include "chrome/browser/plugins/chrome_plugin_service_filter.h" |
28 #include "chrome/browser/plugins/plugin_prefs.h" | 27 #include "chrome/browser/plugins/plugin_prefs.h" |
29 #include "chrome/browser/prefs/incognito_mode_prefs.h" | 28 #include "chrome/browser/prefs/incognito_mode_prefs.h" |
30 #include "chrome/browser/prefs/pref_service_syncable.h" | 29 #include "chrome/browser/prefs/pref_service_syncable.h" |
31 #include "chrome/browser/ssl/chrome_ssl_host_state_delegate.h" | 30 #include "chrome/browser/ssl/chrome_ssl_host_state_delegate.h" |
32 #include "chrome/browser/ssl/chrome_ssl_host_state_delegate_factory.h" | 31 #include "chrome/browser/ssl/chrome_ssl_host_state_delegate_factory.h" |
33 #include "chrome/browser/themes/theme_service.h" | 32 #include "chrome/browser/themes/theme_service.h" |
34 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" | 33 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" |
35 #include "chrome/browser/ui/zoom/chrome_zoom_level_otr_delegate.h" | 34 #include "chrome/browser/ui/zoom/chrome_zoom_level_otr_delegate.h" |
36 #include "chrome/common/chrome_constants.h" | 35 #include "chrome/common/chrome_constants.h" |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 #endif | 125 #endif |
127 | 126 |
128 BrowserContextDependencyManager::GetInstance()->CreateBrowserContextServices( | 127 BrowserContextDependencyManager::GetInstance()->CreateBrowserContextServices( |
129 this); | 128 this); |
130 | 129 |
131 // Guest profiles may always be OTR. Check IncognitoModePrefs otherwise. | 130 // Guest profiles may always be OTR. Check IncognitoModePrefs otherwise. |
132 DCHECK(profile_->IsGuestSession() || | 131 DCHECK(profile_->IsGuestSession() || |
133 IncognitoModePrefs::GetAvailability(profile_->GetPrefs()) != | 132 IncognitoModePrefs::GetAvailability(profile_->GetPrefs()) != |
134 IncognitoModePrefs::DISABLED); | 133 IncognitoModePrefs::DISABLED); |
135 | 134 |
136 // Clear the proxy pref if and only if the data reduction proxy is specified. | |
137 DataReductionProxyChromeConfigurator::DisableInProxyConfigPref(prefs_); | |
138 | |
139 // TODO(oshima): Remove the need to eagerly initialize the request context | 135 // TODO(oshima): Remove the need to eagerly initialize the request context |
140 // getter. chromeos::OnlineAttempt is illegally trying to access this | 136 // getter. chromeos::OnlineAttempt is illegally trying to access this |
141 // Profile member from a thread other than the UI thread, so we need to | 137 // Profile member from a thread other than the UI thread, so we need to |
142 // prevent a race. | 138 // prevent a race. |
143 #if defined(OS_CHROMEOS) | 139 #if defined(OS_CHROMEOS) |
144 GetRequestContext(); | 140 GetRequestContext(); |
145 #endif // defined(OS_CHROMEOS) | 141 #endif // defined(OS_CHROMEOS) |
146 | 142 |
147 TrackZoomLevelsFromParent(); | 143 TrackZoomLevelsFromParent(); |
148 | 144 |
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
557 PrefProxyConfigTracker* OffTheRecordProfileImpl::CreateProxyConfigTracker() { | 553 PrefProxyConfigTracker* OffTheRecordProfileImpl::CreateProxyConfigTracker() { |
558 #if defined(OS_CHROMEOS) | 554 #if defined(OS_CHROMEOS) |
559 if (chromeos::ProfileHelper::IsSigninProfile(this)) { | 555 if (chromeos::ProfileHelper::IsSigninProfile(this)) { |
560 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState( | 556 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState( |
561 g_browser_process->local_state()); | 557 g_browser_process->local_state()); |
562 } | 558 } |
563 #endif // defined(OS_CHROMEOS) | 559 #endif // defined(OS_CHROMEOS) |
564 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfProfile( | 560 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfProfile( |
565 GetPrefs(), g_browser_process->local_state()); | 561 GetPrefs(), g_browser_process->local_state()); |
566 } | 562 } |
OLD | NEW |