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

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

Issue 1326353002: Remove dependency of PrefSyncableService on Profile. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@pref_model_associator
Patch Set: Move files back to //chrome/browser/prefs & //chrome/test/base Created 5 years, 3 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
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/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 10 matching lines...) Expand all
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/proxy_service_factory.h" 24 #include "chrome/browser/net/proxy_service_factory.h"
25 #include "chrome/browser/permissions/permission_manager.h" 25 #include "chrome/browser/permissions/permission_manager.h"
26 #include "chrome/browser/permissions/permission_manager_factory.h" 26 #include "chrome/browser/permissions/permission_manager_factory.h"
27 #include "chrome/browser/plugins/chrome_plugin_service_filter.h" 27 #include "chrome/browser/plugins/chrome_plugin_service_filter.h"
28 #include "chrome/browser/plugins/plugin_prefs.h" 28 #include "chrome/browser/plugins/plugin_prefs.h"
29 #include "chrome/browser/prefs/incognito_mode_prefs.h" 29 #include "chrome/browser/prefs/incognito_mode_prefs.h"
30 #include "chrome/browser/prefs/pref_service_syncable.h" 30 #include "chrome/browser/prefs/pref_service_syncable.h"
31 #include "chrome/browser/prefs/pref_service_syncable_util.h"
31 #include "chrome/browser/profiles/profile_manager.h" 32 #include "chrome/browser/profiles/profile_manager.h"
32 #include "chrome/browser/ssl/chrome_ssl_host_state_delegate.h" 33 #include "chrome/browser/ssl/chrome_ssl_host_state_delegate.h"
33 #include "chrome/browser/ssl/chrome_ssl_host_state_delegate_factory.h" 34 #include "chrome/browser/ssl/chrome_ssl_host_state_delegate_factory.h"
34 #include "chrome/browser/themes/theme_service.h" 35 #include "chrome/browser/themes/theme_service.h"
35 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" 36 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h"
36 #include "chrome/browser/ui/zoom/chrome_zoom_level_otr_delegate.h" 37 #include "chrome/browser/ui/zoom/chrome_zoom_level_otr_delegate.h"
37 #include "chrome/common/chrome_constants.h" 38 #include "chrome/common/chrome_constants.h"
38 #include "chrome/common/chrome_paths.h" 39 #include "chrome/common/chrome_paths.h"
39 #include "chrome/common/chrome_switches.h" 40 #include "chrome/common/chrome_switches.h"
40 #include "components/content_settings/core/browser/host_content_settings_map.h" 41 #include "components/content_settings/core/browser/host_content_settings_map.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 void* otr_profile) { 104 void* otr_profile) {
104 extensions::ExtensionWebRequestEventRouter::GetInstance() 105 extensions::ExtensionWebRequestEventRouter::GetInstance()
105 ->OnOTRBrowserContextDestroyed(original_profile, otr_profile); 106 ->OnOTRBrowserContextDestroyed(original_profile, otr_profile);
106 } 107 }
107 108
108 } // namespace 109 } // namespace
109 #endif 110 #endif
110 111
111 OffTheRecordProfileImpl::OffTheRecordProfileImpl(Profile* real_profile) 112 OffTheRecordProfileImpl::OffTheRecordProfileImpl(Profile* real_profile)
112 : profile_(real_profile), 113 : profile_(real_profile),
113 prefs_(PrefServiceSyncable::IncognitoFromProfile(real_profile)), 114 prefs_(PrefServiceSyncableIncognitoFromProfile(real_profile)),
114 start_time_(Time::Now()) { 115 start_time_(Time::Now()) {
115 // Register on BrowserContext. 116 // Register on BrowserContext.
116 user_prefs::UserPrefs::Set(this, prefs_); 117 user_prefs::UserPrefs::Set(this, prefs_);
117 } 118 }
118 119
119 void OffTheRecordProfileImpl::Init() { 120 void OffTheRecordProfileImpl::Init() {
120 // The construction of OffTheRecordProfileIOData::Handle needs the profile 121 // The construction of OffTheRecordProfileIOData::Handle needs the profile
121 // type returned by this->GetProfileType(). Since GetProfileType() is a 122 // type returned by this->GetProfileType(). Since GetProfileType() is a
122 // virtual member function, we cannot call the function defined in the most 123 // virtual member function, we cannot call the function defined in the most
123 // derived class (e.g. GuestSessionProfile) until a ctor finishes. Thus, 124 // derived class (e.g. GuestSessionProfile) until a ctor finishes. Thus,
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after
582 PrefProxyConfigTracker* OffTheRecordProfileImpl::CreateProxyConfigTracker() { 583 PrefProxyConfigTracker* OffTheRecordProfileImpl::CreateProxyConfigTracker() {
583 #if defined(OS_CHROMEOS) 584 #if defined(OS_CHROMEOS)
584 if (chromeos::ProfileHelper::IsSigninProfile(this)) { 585 if (chromeos::ProfileHelper::IsSigninProfile(this)) {
585 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState( 586 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState(
586 g_browser_process->local_state()); 587 g_browser_process->local_state());
587 } 588 }
588 #endif // defined(OS_CHROMEOS) 589 #endif // defined(OS_CHROMEOS)
589 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfProfile( 590 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfProfile(
590 GetPrefs(), g_browser_process->local_state()); 591 GetPrefs(), g_browser_process->local_state());
591 } 592 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698