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 <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 #if defined(OS_ANDROID) | 66 #if defined(OS_ANDROID) |
67 #include "components/prefs/scoped_user_pref_update.h" | 67 #include "components/prefs/scoped_user_pref_update.h" |
68 #include "components/proxy_config/proxy_prefs.h" | 68 #include "components/proxy_config/proxy_prefs.h" |
69 #endif // defined(OS_ANDROID) | 69 #endif // defined(OS_ANDROID) |
70 | 70 |
71 #if defined(OS_CHROMEOS) | 71 #if defined(OS_CHROMEOS) |
72 #include "chrome/browser/chromeos/preferences.h" | 72 #include "chrome/browser/chromeos/preferences.h" |
73 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 73 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
74 #endif | 74 #endif |
75 | 75 |
76 #if defined(ENABLE_CONFIGURATION_POLICY) && !defined(OS_CHROMEOS) | 76 #if !defined(OS_CHROMEOS) |
77 #include "chrome/browser/policy/cloud/user_cloud_policy_manager_factory.h" | 77 #include "chrome/browser/policy/cloud/user_cloud_policy_manager_factory.h" |
78 #endif | 78 #endif |
79 | 79 |
80 #if defined(ENABLE_EXTENSIONS) | 80 #if defined(ENABLE_EXTENSIONS) |
81 #include "chrome/browser/extensions/extension_service.h" | 81 #include "chrome/browser/extensions/extension_service.h" |
82 #include "chrome/browser/extensions/extension_special_storage_policy.h" | 82 #include "chrome/browser/extensions/extension_special_storage_policy.h" |
83 #include "components/guest_view/browser/guest_view_manager.h" | 83 #include "components/guest_view/browser/guest_view_manager.h" |
84 #include "extensions/browser/api/web_request/web_request_api.h" | 84 #include "extensions/browser/api/web_request/web_request_api.h" |
85 #include "extensions/browser/extension_system.h" | 85 #include "extensions/browser/extension_system.h" |
86 #include "extensions/common/extension.h" | 86 #include "extensions/common/extension.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 } | 124 } |
125 | 125 |
126 void OffTheRecordProfileImpl::Init() { | 126 void OffTheRecordProfileImpl::Init() { |
127 // The construction of OffTheRecordProfileIOData::Handle needs the profile | 127 // The construction of OffTheRecordProfileIOData::Handle needs the profile |
128 // type returned by this->GetProfileType(). Since GetProfileType() is a | 128 // type returned by this->GetProfileType(). Since GetProfileType() is a |
129 // virtual member function, we cannot call the function defined in the most | 129 // virtual member function, we cannot call the function defined in the most |
130 // derived class (e.g. GuestSessionProfile) until a ctor finishes. Thus, | 130 // derived class (e.g. GuestSessionProfile) until a ctor finishes. Thus, |
131 // we have to instantiate OffTheRecordProfileIOData::Handle here after a ctor. | 131 // we have to instantiate OffTheRecordProfileIOData::Handle here after a ctor. |
132 InitIoData(); | 132 InitIoData(); |
133 | 133 |
134 #if defined(ENABLE_CONFIGURATION_POLICY) && !defined(OS_CHROMEOS) | 134 #if !defined(OS_CHROMEOS) |
135 // Because UserCloudPolicyManager is in a component, it cannot access | 135 // Because UserCloudPolicyManager is in a component, it cannot access |
136 // GetOriginalProfile. Instead, we have to inject this relation here. | 136 // GetOriginalProfile. Instead, we have to inject this relation here. |
137 policy::UserCloudPolicyManagerFactory::RegisterForOffTheRecordBrowserContext( | 137 policy::UserCloudPolicyManagerFactory::RegisterForOffTheRecordBrowserContext( |
138 this->GetOriginalProfile(), this); | 138 this->GetOriginalProfile(), this); |
139 #endif | 139 #endif |
140 | 140 |
141 BrowserContextDependencyManager::GetInstance()->CreateBrowserContextServices( | 141 BrowserContextDependencyManager::GetInstance()->CreateBrowserContextServices( |
142 this); | 142 this); |
143 | 143 |
144 set_is_guest_profile( | 144 set_is_guest_profile( |
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
567 PrefProxyConfigTracker* OffTheRecordProfileImpl::CreateProxyConfigTracker() { | 567 PrefProxyConfigTracker* OffTheRecordProfileImpl::CreateProxyConfigTracker() { |
568 #if defined(OS_CHROMEOS) | 568 #if defined(OS_CHROMEOS) |
569 if (chromeos::ProfileHelper::IsSigninProfile(this)) { | 569 if (chromeos::ProfileHelper::IsSigninProfile(this)) { |
570 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState( | 570 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState( |
571 g_browser_process->local_state()); | 571 g_browser_process->local_state()); |
572 } | 572 } |
573 #endif // defined(OS_CHROMEOS) | 573 #endif // defined(OS_CHROMEOS) |
574 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfProfile( | 574 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfProfile( |
575 GetPrefs(), g_browser_process->local_state()); | 575 GetPrefs(), g_browser_process->local_state()); |
576 } | 576 } |
OLD | NEW |