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

Side by Side Diff: chrome/browser/profiles/profile.h

Issue 11308362: Add StoragePartition's ProtocolHandlers at URLRequestContext construction time. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Eliminate OffTheRecordProfileIOData::Handle::GetMainRequestContextGetter Created 7 years, 11 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 // This class gathers state related to a single user profile. 5 // This class gathers state related to a single user profile.
6 6
7 #ifndef CHROME_BROWSER_PROFILES_PROFILE_H_ 7 #ifndef CHROME_BROWSER_PROFILES_PROFILE_H_
8 #define CHROME_BROWSER_PROFILES_PROFILE_H_ 8 #define CHROME_BROWSER_PROFILES_PROFILE_H_
9 9
10 #include <string> 10 #include <string>
11 11
12 #include "base/basictypes.h" 12 #include "base/basictypes.h"
13 #include "base/hash_tables.h" 13 #include "base/hash_tables.h"
14 #include "base/logging.h" 14 #include "base/logging.h"
15 #include "chrome/browser/net/pref_proxy_config_tracker.h" 15 #include "chrome/browser/net/pref_proxy_config_tracker.h"
16 #include "chrome/browser/ui/webui/chrome_url_data_manager_factory.h" 16 #include "chrome/browser/ui/webui/chrome_url_data_manager_factory.h"
17 #include "content/public/browser/browser_context.h" 17 #include "content/public/browser/browser_context.h"
18 #include "net/url_request/url_request_job_factory.h"
18 19
19 class ChromeAppCacheService; 20 class ChromeAppCacheService;
20 class ChromeURLDataManager; 21 class ChromeURLDataManager;
21 class ExtensionService; 22 class ExtensionService;
22 class ExtensionSpecialStoragePolicy; 23 class ExtensionSpecialStoragePolicy;
23 class FaviconService; 24 class FaviconService;
24 class HostContentSettingsMap; 25 class HostContentSettingsMap;
25 class PasswordStore; 26 class PasswordStore;
26 class PrefServiceSyncable; 27 class PrefServiceSyncable;
27 class PromoCounter; 28 class PromoCounter;
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 // time that this method is called. 221 // time that this method is called.
221 virtual PrefServiceSyncable* GetOffTheRecordPrefs() = 0; 222 virtual PrefServiceSyncable* GetOffTheRecordPrefs() = 0;
222 223
223 // Returns the main request context. 224 // Returns the main request context.
224 virtual net::URLRequestContextGetter* GetRequestContext() = 0; 225 virtual net::URLRequestContextGetter* GetRequestContext() = 0;
225 226
226 // Returns the request context used for extension-related requests. This 227 // Returns the request context used for extension-related requests. This
227 // is only used for a separate cookie store currently. 228 // is only used for a separate cookie store currently.
228 virtual net::URLRequestContextGetter* GetRequestContextForExtensions() = 0; 229 virtual net::URLRequestContextGetter* GetRequestContextForExtensions() = 0;
229 230
230 // Returns the request context used within |partition_id|.
231 virtual net::URLRequestContextGetter* GetRequestContextForStoragePartition(
232 const FilePath& partition_path,
233 bool in_memory) = 0;
234
235 // Returns the SSLConfigService for this profile. 231 // Returns the SSLConfigService for this profile.
236 virtual net::SSLConfigService* GetSSLConfigService() = 0; 232 virtual net::SSLConfigService* GetSSLConfigService() = 0;
237 233
238 // Returns the Hostname <-> Content settings map for this profile. 234 // Returns the Hostname <-> Content settings map for this profile.
239 virtual HostContentSettingsMap* GetHostContentSettingsMap() = 0; 235 virtual HostContentSettingsMap* GetHostContentSettingsMap() = 0;
240 236
241 // Returns the ProtocolHandlerRegistry, creating if not yet created. 237 // Returns the ProtocolHandlerRegistry, creating if not yet created.
242 // TODO(smckay): replace this with access via ProtocolHandlerRegistryFactory. 238 // TODO(smckay): replace this with access via ProtocolHandlerRegistryFactory.
243 virtual ProtocolHandlerRegistry* GetProtocolHandlerRegistry() = 0; 239 virtual ProtocolHandlerRegistry* GetProtocolHandlerRegistry() = 0;
244 240
245 // Return whether 2 profiles are the same. 2 profiles are the same if they 241 // Return whether 2 profiles are the same. 2 profiles are the same if they
246 // represent the same profile. This can happen if there is pointer equality 242 // represent the same profile. This can happen if there is pointer equality
247 // or if one profile is the incognito version of another profile (or vice 243 // or if one profile is the incognito version of another profile (or vice
248 // versa). 244 // versa).
249 virtual bool IsSameProfile(Profile* profile) = 0; 245 virtual bool IsSameProfile(Profile* profile) = 0;
250 246
251 // Returns the time the profile was started. This is not the time the profile 247 // Returns the time the profile was started. This is not the time the profile
252 // was created, rather it is the time the user started chrome and logged into 248 // was created, rather it is the time the user started chrome and logged into
253 // this profile. For the single profile case, this corresponds to the time 249 // this profile. For the single profile case, this corresponds to the time
254 // the user started chrome. 250 // the user started chrome.
255 virtual base::Time GetStartTime() const = 0; 251 virtual base::Time GetStartTime() const = 0;
256 252
253 // Creates the main net::URLRequestContextGetter that will be returned by
254 // GetRequestContext(). Should only be called once per ContentBrowserClient
255 // object. This function is exposed because of the circular dependency where
256 // GetStoragePartition() is used to retrieve the request context, but creation
257 // still has to happen in the Profile so the StoragePartition calls
258 // ContextBrowserClient to call this function.
259 // TODO(ajwong): Remove once http://crbug.com/159193 is resolved.
260 virtual net::URLRequestContextGetter* CreateRequestContext(
261 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
262 blob_protocol_handler,
263 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
264 file_system_protocol_handler,
265 scoped_ptr<net::URLRequestJobFactory::Interceptor>
266 developer_protocol_handler) = 0;
267
268 // Creates the net::URLRequestContextGetter for a StoragePartition. Should
269 // only be called once per partition_path per ContentBrowserClient object.
270 // This function is exposed because the request context is retrieved from the
271 // StoragePartition, but creation still has to happen in the Profile so the
272 // StoragePartition calls ContextBrowserClient to call this function.
273 // TODO(ajwong): Remove once http://crbug.com/159193 is resolved.
274 virtual net::URLRequestContextGetter* CreateRequestContextForStoragePartition(
275 const FilePath& partition_path,
276 bool in_memory,
277 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
278 blob_protocol_handler,
279 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
280 file_system_protocol_handler,
281 scoped_ptr<net::URLRequestJobFactory::Interceptor>
282 developer_protocol_handler) = 0;
283
257 // Returns the last directory that was chosen for uploading or opening a file. 284 // Returns the last directory that was chosen for uploading or opening a file.
258 virtual FilePath last_selected_directory() = 0; 285 virtual FilePath last_selected_directory() = 0;
259 virtual void set_last_selected_directory(const FilePath& path) = 0; 286 virtual void set_last_selected_directory(const FilePath& path) = 0;
260 287
261 #if defined(OS_CHROMEOS) 288 #if defined(OS_CHROMEOS)
262 enum AppLocaleChangedVia { 289 enum AppLocaleChangedVia {
263 // Caused by chrome://settings change. 290 // Caused by chrome://settings change.
264 APP_LOCALE_CHANGED_VIA_SETTINGS, 291 APP_LOCALE_CHANGED_VIA_SETTINGS,
265 // Locale has been reverted via LocaleChangeGuard. 292 // Locale has been reverted via LocaleChangeGuard.
266 APP_LOCALE_CHANGED_VIA_REVERT, 293 APP_LOCALE_CHANGED_VIA_REVERT,
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
395 struct hash<Profile*> { 422 struct hash<Profile*> {
396 std::size_t operator()(Profile* const& p) const { 423 std::size_t operator()(Profile* const& p) const {
397 return reinterpret_cast<std::size_t>(p); 424 return reinterpret_cast<std::size_t>(p);
398 } 425 }
399 }; 426 };
400 427
401 } // namespace BASE_HASH_NAMESPACE 428 } // namespace BASE_HASH_NAMESPACE
402 #endif 429 #endif
403 430
404 #endif // CHROME_BROWSER_PROFILES_PROFILE_H_ 431 #endif // CHROME_BROWSER_PROFILES_PROFILE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698