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 "components/domain_reliability/clear_mode.h"
13 #include "content/public/browser/browser_context.h"
15 class ResourceContext
;
18 class URLRequestContextGetter
;
22 class DownloadManagerDelegate
;
23 class ResourceContext
;
24 class SSLHostStateDelegate
;
25 class ZoomLevelDelegate
;
28 class FakeProfile
: public Profile
{
30 explicit FakeProfile(const std::string
& name
);
31 FakeProfile(const std::string
& name
, const base::FilePath
& path
);
34 std::string
GetProfileUserName() const override
;
35 ProfileType
GetProfileType() const override
;
36 base::FilePath
GetPath() const override
;
37 scoped_ptr
<content::ZoomLevelDelegate
> CreateZoomLevelDelegate(
38 const base::FilePath
& partition_path
) override
;
39 bool IsOffTheRecord() const override
;
40 content::DownloadManagerDelegate
* GetDownloadManagerDelegate() override
;
41 net::URLRequestContextGetter
* GetRequestContextForRenderProcess(
42 int renderer_child_id
) override
;
43 net::URLRequestContextGetter
* GetMediaRequestContext() override
;
44 net::URLRequestContextGetter
* GetMediaRequestContextForRenderProcess(
45 int renderer_child_id
) override
;
46 net::URLRequestContextGetter
* GetMediaRequestContextForStoragePartition(
47 const base::FilePath
& partition_path
,
48 bool in_memory
) override
;
49 content::ResourceContext
* GetResourceContext() override
;
50 content::BrowserPluginGuestManager
* GetGuestManager() override
;
51 storage::SpecialStoragePolicy
* GetSpecialStoragePolicy() override
;
52 content::PushMessagingService
* GetPushMessagingService() override
;
53 content::SSLHostStateDelegate
* GetSSLHostStateDelegate() override
;
54 content::PermissionManager
* GetPermissionManager() override
;
55 scoped_refptr
<base::SequencedTaskRunner
> GetIOTaskRunner() override
;
56 Profile
* GetOffTheRecordProfile() override
;
57 void DestroyOffTheRecordProfile() override
;
58 bool HasOffTheRecordProfile() override
;
59 Profile
* GetOriginalProfile() override
;
60 bool IsSupervised() const override
;
61 bool IsChild() const override
;
62 bool IsLegacySupervised() const override
;
63 ExtensionSpecialStoragePolicy
* GetExtensionSpecialStoragePolicy() override
;
64 PrefService
* GetPrefs() override
;
65 const PrefService
* GetPrefs() const override
;
66 PrefService
* GetOffTheRecordPrefs() override
;
67 net::URLRequestContextGetter
* GetRequestContext() override
;
68 net::URLRequestContextGetter
* GetRequestContextForExtensions() override
;
69 net::SSLConfigService
* GetSSLConfigService() override
;
70 HostContentSettingsMap
* GetHostContentSettingsMap() override
;
71 bool IsSameProfile(Profile
* profile
) override
;
72 base::Time
GetStartTime() const override
;
73 net::URLRequestContextGetter
* CreateRequestContext(
74 content::ProtocolHandlerMap
* protocol_handlers
,
75 content::URLRequestInterceptorScopedVector request_interceptors
) override
;
76 net::URLRequestContextGetter
* CreateRequestContextForStoragePartition(
77 const base::FilePath
& partition_path
,
79 content::ProtocolHandlerMap
* protocol_handlers
,
80 content::URLRequestInterceptorScopedVector request_interceptors
) override
;
81 base::FilePath
last_selected_directory() override
;
82 void set_last_selected_directory(const base::FilePath
& path
) override
;
84 #if defined(OS_CHROMEOS)
85 void ChangeAppLocale(const std::string
& locale
,
86 AppLocaleChangedVia via
) override
;
87 void OnLogin() override
;
88 void InitChromeOSPreferences() override
;
89 #endif // defined(OS_CHROMEOS)
91 PrefProxyConfigTracker
* GetProxyConfigTracker() override
;
92 chrome_browser_net::Predictor
* GetNetworkPredictor() override
;
93 DevToolsNetworkControllerHandle
* GetDevToolsNetworkControllerHandle()
95 void ClearNetworkingHistorySince(base::Time time
,
96 const base::Closure
& completion
) override
;
97 GURL
GetHomePage() override
;
98 bool WasCreatedByVersionOrLater(const std::string
& version
) override
;
99 void SetExitType(ExitType exit_type
) override
;
100 ExitType
GetLastSessionExitType() override
;
104 base::FilePath path_
;
107 #endif // CHROME_BROWSER_UI_APP_LIST_TEST_FAKE_PROFILE_H_