1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_UI_APP_LIST_TEST_FAKE_PROFILE_H_
6 #define CHROME_BROWSER_UI_APP_LIST_TEST_FAKE_PROFILE_H_
8 #include "base/files/file_path.h"
9 #include "base/memory/ref_counted.h"
10 #include "base/sequenced_task_runner.h"
11 #include "chrome/browser/profiles/profile.h"
12 #include "content/public/browser/browser_context.h"
14 class ResourceContext
;
17 class URLRequestContextGetter
;
21 class DownloadManagerDelegate
;
22 class GeolocationPermissionContext
;
23 class ResourceContext
;
26 class FakeProfile
: public Profile
{
28 explicit FakeProfile(const std::string
& name
);
29 FakeProfile(const std::string
& name
, const base::FilePath
& path
);
32 virtual std::string
GetProfileName() OVERRIDE
;
33 virtual base::FilePath
GetPath() const OVERRIDE
;
34 virtual bool IsOffTheRecord() const OVERRIDE
;
35 virtual content::DownloadManagerDelegate
*
36 GetDownloadManagerDelegate() OVERRIDE
;
37 virtual net::URLRequestContextGetter
* GetRequestContextForRenderProcess(
38 int renderer_child_id
) OVERRIDE
;
39 virtual net::URLRequestContextGetter
* GetMediaRequestContext() OVERRIDE
;
40 virtual net::URLRequestContextGetter
* GetMediaRequestContextForRenderProcess(
41 int renderer_child_id
) OVERRIDE
;
42 virtual net::URLRequestContextGetter
*
43 GetMediaRequestContextForStoragePartition(
44 const base::FilePath
& partition_path
,
45 bool in_memory
) OVERRIDE
;
46 virtual void RequestMIDISysExPermission(
47 int render_process_id
,
50 const GURL
& requesting_frame
,
51 const MIDISysExPermissionCallback
& callback
) OVERRIDE
;
52 virtual void CancelMIDISysExPermissionRequest(
53 int render_process_id
,
56 const GURL
& requesting_frame
) OVERRIDE
;
57 virtual void RequestProtectedMediaIdentifierPermission(
58 int render_process_id
,
62 const GURL
& requesting_frame
,
63 const ProtectedMediaIdentifierPermissionCallback
& callback
) OVERRIDE
;
64 virtual void CancelProtectedMediaIdentifierPermissionRequests(
65 int group_id
) OVERRIDE
;
66 virtual content::ResourceContext
* GetResourceContext() OVERRIDE
;
67 virtual content::GeolocationPermissionContext
*
68 GetGeolocationPermissionContext() OVERRIDE
;
69 virtual quota::SpecialStoragePolicy
* GetSpecialStoragePolicy() OVERRIDE
;
70 virtual scoped_refptr
<base::SequencedTaskRunner
> GetIOTaskRunner() OVERRIDE
;
71 virtual Profile
* GetOffTheRecordProfile() OVERRIDE
;
72 virtual void DestroyOffTheRecordProfile() OVERRIDE
;
73 virtual bool HasOffTheRecordProfile() OVERRIDE
;
74 virtual Profile
* GetOriginalProfile() OVERRIDE
;
75 virtual bool IsManaged() OVERRIDE
;
76 virtual history::TopSites
* GetTopSites() OVERRIDE
;
77 virtual history::TopSites
* GetTopSitesWithoutCreating() OVERRIDE
;
78 virtual ExtensionService
* GetExtensionService() OVERRIDE
;
79 virtual ExtensionSpecialStoragePolicy
*
80 GetExtensionSpecialStoragePolicy() OVERRIDE
;
81 virtual PrefService
* GetPrefs() OVERRIDE
;
82 virtual PrefService
* GetOffTheRecordPrefs() OVERRIDE
;
83 virtual net::URLRequestContextGetter
* GetRequestContext() OVERRIDE
;
84 virtual net::URLRequestContextGetter
*
85 GetRequestContextForExtensions() OVERRIDE
;
86 virtual net::SSLConfigService
* GetSSLConfigService() OVERRIDE
;
87 virtual HostContentSettingsMap
* GetHostContentSettingsMap() OVERRIDE
;
88 virtual bool IsSameProfile(Profile
* profile
) OVERRIDE
;
89 virtual base::Time
GetStartTime() const OVERRIDE
;
90 virtual net::URLRequestContextGetter
* CreateRequestContext(
91 content::ProtocolHandlerMap
* protocol_handlers
) OVERRIDE
;
92 virtual net::URLRequestContextGetter
* CreateRequestContextForStoragePartition(
93 const base::FilePath
& partition_path
,
95 content::ProtocolHandlerMap
* protocol_handlers
) OVERRIDE
;
96 virtual base::FilePath
last_selected_directory() OVERRIDE
;
97 virtual void set_last_selected_directory(const base::FilePath
& path
) OVERRIDE
;
99 #if defined(OS_CHROMEOS)
100 virtual void ChangeAppLocale(
101 const std::string
& locale
, AppLocaleChangedVia via
) OVERRIDE
;
102 virtual void OnLogin() OVERRIDE
;
103 virtual void InitChromeOSPreferences() OVERRIDE
;
104 #endif // defined(OS_CHROMEOS)
106 virtual PrefProxyConfigTracker
* GetProxyConfigTracker() OVERRIDE
;
107 virtual chrome_browser_net::Predictor
* GetNetworkPredictor() OVERRIDE
;
108 virtual void ClearNetworkingHistorySince(
109 base::Time time
, const base::Closure
& completion
) OVERRIDE
;
110 virtual GURL
GetHomePage() OVERRIDE
;
111 virtual bool WasCreatedByVersionOrLater(const std::string
& version
) OVERRIDE
;
112 virtual void SetExitType(ExitType exit_type
) OVERRIDE
;
113 virtual ExitType
GetLastSessionExitType() OVERRIDE
;
117 base::FilePath path_
;
120 #endif // CHROME_BROWSER_UI_APP_LIST_TEST_FAKE_PROFILE_H_