| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 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/ui/app_list/test/fake_profile.h" | 5 #include "chrome/browser/ui/app_list/test/fake_profile.h" |
| 6 | 6 |
| 7 FakeProfile::FakeProfile(const std::string& name) | 7 FakeProfile::FakeProfile(const std::string& name) |
| 8 : name_(name) { | 8 : name_(name) { |
| 9 } | 9 } |
| 10 | 10 |
| 11 FakeProfile::FakeProfile(const std::string& name, const base::FilePath& path) | 11 FakeProfile::FakeProfile(const std::string& name, const base::FilePath& path) |
| 12 : name_(name), | 12 : name_(name), |
| 13 path_(path) { | 13 path_(path) { |
| 14 } | 14 } |
| 15 | 15 |
| 16 std::string FakeProfile::GetProfileUserName() { | 16 std::string FakeProfile::GetProfileUserName() const { |
| 17 return name_; | 17 return name_; |
| 18 } | 18 } |
| 19 | 19 |
| 20 Profile::ProfileType FakeProfile::GetProfileType() const { | 20 Profile::ProfileType FakeProfile::GetProfileType() const { |
| 21 return REGULAR_PROFILE; | 21 return REGULAR_PROFILE; |
| 22 } | 22 } |
| 23 | 23 |
| 24 base::FilePath FakeProfile::GetPath() const { | 24 base::FilePath FakeProfile::GetPath() const { |
| 25 return path_; | 25 return path_; |
| 26 } | 26 } |
| 27 | 27 |
| 28 scoped_ptr<content::ZoomLevelDelegate> FakeProfile::CreateZoomLevelDelegate( | 28 scoped_ptr<content::ZoomLevelDelegate> FakeProfile::CreateZoomLevelDelegate( |
| 29 const base::FilePath& partition_path) { | 29 const base::FilePath& partition_path) { |
| 30 return nullptr; | 30 return nullptr; |
| 31 } | 31 } |
| 32 | 32 |
| 33 bool FakeProfile::IsOffTheRecord() const { | 33 bool FakeProfile::IsOffTheRecord() const { |
| 34 return false; | 34 return false; |
| 35 } | 35 } |
| 36 | 36 |
| 37 content::DownloadManagerDelegate* | 37 content::DownloadManagerDelegate* FakeProfile::GetDownloadManagerDelegate() { |
| 38 FakeProfile::GetDownloadManagerDelegate() { | 38 return nullptr; |
| 39 return NULL; | |
| 40 } | 39 } |
| 41 | 40 |
| 42 net::URLRequestContextGetter* FakeProfile::GetRequestContextForRenderProcess( | 41 net::URLRequestContextGetter* FakeProfile::GetRequestContextForRenderProcess( |
| 43 int renderer_child_id) { | 42 int renderer_child_id) { |
| 44 return NULL; | 43 return nullptr; |
| 45 } | 44 } |
| 46 | 45 |
| 47 net::URLRequestContextGetter* FakeProfile::GetMediaRequestContext() { | 46 net::URLRequestContextGetter* FakeProfile::GetMediaRequestContext() { |
| 48 return NULL; | 47 return nullptr; |
| 49 } | 48 } |
| 50 | 49 |
| 51 net::URLRequestContextGetter* | 50 net::URLRequestContextGetter* |
| 52 FakeProfile::GetMediaRequestContextForRenderProcess( | 51 FakeProfile::GetMediaRequestContextForRenderProcess( |
| 53 int renderer_child_id) { | 52 int renderer_child_id) { |
| 54 return NULL; | 53 return nullptr; |
| 55 } | 54 } |
| 56 | 55 |
| 57 net::URLRequestContextGetter* | 56 net::URLRequestContextGetter* |
| 58 FakeProfile::GetMediaRequestContextForStoragePartition( | 57 FakeProfile::GetMediaRequestContextForStoragePartition( |
| 59 const base::FilePath& partition_path, | 58 const base::FilePath& partition_path, |
| 60 bool in_memory) { | 59 bool in_memory) { |
| 61 return NULL; | 60 return nullptr; |
| 62 } | 61 } |
| 63 | 62 |
| 64 content::ResourceContext* FakeProfile::GetResourceContext() { | 63 content::ResourceContext* FakeProfile::GetResourceContext() { |
| 65 return NULL; | 64 return nullptr; |
| 66 } | 65 } |
| 67 | 66 |
| 68 content::BrowserPluginGuestManager* FakeProfile::GetGuestManager() { | 67 content::BrowserPluginGuestManager* FakeProfile::GetGuestManager() { |
| 69 return NULL; | 68 return nullptr; |
| 70 } | 69 } |
| 71 | 70 |
| 72 storage::SpecialStoragePolicy* FakeProfile::GetSpecialStoragePolicy() { | 71 storage::SpecialStoragePolicy* FakeProfile::GetSpecialStoragePolicy() { |
| 73 return NULL; | 72 return nullptr; |
| 74 } | 73 } |
| 75 | 74 |
| 76 content::PushMessagingService* FakeProfile::GetPushMessagingService() { | 75 content::PushMessagingService* FakeProfile::GetPushMessagingService() { |
| 77 return NULL; | 76 return nullptr; |
| 78 } | 77 } |
| 79 | 78 |
| 80 content::SSLHostStateDelegate* FakeProfile::GetSSLHostStateDelegate() { | 79 content::SSLHostStateDelegate* FakeProfile::GetSSLHostStateDelegate() { |
| 81 return NULL; | 80 return nullptr; |
| 82 } | 81 } |
| 83 | 82 |
| 84 scoped_refptr<base::SequencedTaskRunner> | 83 scoped_refptr<base::SequencedTaskRunner> |
| 85 FakeProfile::GetIOTaskRunner() { | 84 FakeProfile::GetIOTaskRunner() { |
| 86 return scoped_refptr<base::SequencedTaskRunner>(); | 85 return scoped_refptr<base::SequencedTaskRunner>(); |
| 87 } | 86 } |
| 88 | 87 |
| 89 Profile* FakeProfile::GetOffTheRecordProfile() { | 88 Profile* FakeProfile::GetOffTheRecordProfile() { |
| 90 return NULL; | 89 return nullptr; |
| 91 } | 90 } |
| 92 | 91 |
| 93 void FakeProfile::DestroyOffTheRecordProfile() {} | 92 void FakeProfile::DestroyOffTheRecordProfile() {} |
| 94 | 93 |
| 95 bool FakeProfile::HasOffTheRecordProfile() { | 94 bool FakeProfile::HasOffTheRecordProfile() { |
| 96 return false; | 95 return false; |
| 97 } | 96 } |
| 98 | 97 |
| 99 Profile* FakeProfile::GetOriginalProfile() { | 98 Profile* FakeProfile::GetOriginalProfile() { |
| 100 return this; | 99 return this; |
| 101 } | 100 } |
| 102 | 101 |
| 103 bool FakeProfile::IsSupervised() { | 102 bool FakeProfile::IsSupervised() { |
| 104 return false; | 103 return false; |
| 105 } | 104 } |
| 106 | 105 |
| 107 bool FakeProfile::IsChild() { | 106 bool FakeProfile::IsChild() { |
| 108 return false; | 107 return false; |
| 109 } | 108 } |
| 110 | 109 |
| 111 bool FakeProfile::IsLegacySupervised() { | 110 bool FakeProfile::IsLegacySupervised() { |
| 112 return false; | 111 return false; |
| 113 } | 112 } |
| 114 | 113 |
| 115 ExtensionSpecialStoragePolicy* FakeProfile::GetExtensionSpecialStoragePolicy() { | 114 ExtensionSpecialStoragePolicy* FakeProfile::GetExtensionSpecialStoragePolicy() { |
| 116 return NULL; | 115 return nullptr; |
| 117 } | 116 } |
| 118 | 117 |
| 119 PrefService* FakeProfile::GetPrefs() { | 118 PrefService* FakeProfile::GetPrefs() { |
| 120 return NULL; | 119 return nullptr; |
| 120 } |
| 121 |
| 122 const PrefService* FakeProfile::GetPrefs() const { |
| 123 return nullptr; |
| 121 } | 124 } |
| 122 | 125 |
| 123 PrefService* FakeProfile::GetOffTheRecordPrefs() { | 126 PrefService* FakeProfile::GetOffTheRecordPrefs() { |
| 124 return NULL; | 127 return nullptr; |
| 125 } | 128 } |
| 126 | 129 |
| 127 net::URLRequestContextGetter* FakeProfile::GetRequestContext() { | 130 net::URLRequestContextGetter* FakeProfile::GetRequestContext() { |
| 128 return NULL; | 131 return nullptr; |
| 129 } | 132 } |
| 130 | 133 |
| 131 net::URLRequestContextGetter* FakeProfile::GetRequestContextForExtensions() { | 134 net::URLRequestContextGetter* FakeProfile::GetRequestContextForExtensions() { |
| 132 return NULL; | 135 return nullptr; |
| 133 } | 136 } |
| 134 | 137 |
| 135 net::SSLConfigService* FakeProfile::GetSSLConfigService() { | 138 net::SSLConfigService* FakeProfile::GetSSLConfigService() { |
| 136 return NULL; | 139 return nullptr; |
| 137 } | 140 } |
| 138 | 141 |
| 139 HostContentSettingsMap* FakeProfile::GetHostContentSettingsMap() { | 142 HostContentSettingsMap* FakeProfile::GetHostContentSettingsMap() { |
| 140 return NULL; | 143 return nullptr; |
| 141 } | 144 } |
| 142 | 145 |
| 143 bool FakeProfile::IsSameProfile(Profile* profile) { | 146 bool FakeProfile::IsSameProfile(Profile* profile) { |
| 144 return false; | 147 return false; |
| 145 } | 148 } |
| 146 | 149 |
| 147 base::Time FakeProfile::GetStartTime() const { | 150 base::Time FakeProfile::GetStartTime() const { |
| 148 return base::Time(); | 151 return base::Time(); |
| 149 } | 152 } |
| 150 | 153 |
| 151 net::URLRequestContextGetter* FakeProfile::CreateRequestContext( | 154 net::URLRequestContextGetter* FakeProfile::CreateRequestContext( |
| 152 content::ProtocolHandlerMap* protocol_handlers, | 155 content::ProtocolHandlerMap* protocol_handlers, |
| 153 content::URLRequestInterceptorScopedVector request_interceptors) { | 156 content::URLRequestInterceptorScopedVector request_interceptors) { |
| 154 return NULL; | 157 return nullptr; |
| 155 } | 158 } |
| 156 | 159 |
| 157 net::URLRequestContextGetter* | 160 net::URLRequestContextGetter* |
| 158 FakeProfile::CreateRequestContextForStoragePartition( | 161 FakeProfile::CreateRequestContextForStoragePartition( |
| 159 const base::FilePath& partition_path, | 162 const base::FilePath& partition_path, |
| 160 bool in_memory, | 163 bool in_memory, |
| 161 content::ProtocolHandlerMap* protocol_handlers, | 164 content::ProtocolHandlerMap* protocol_handlers, |
| 162 content::URLRequestInterceptorScopedVector request_interceptors) { | 165 content::URLRequestInterceptorScopedVector request_interceptors) { |
| 163 return NULL; | 166 return nullptr; |
| 164 } | 167 } |
| 165 | 168 |
| 166 base::FilePath FakeProfile::last_selected_directory() { | 169 base::FilePath FakeProfile::last_selected_directory() { |
| 167 return base::FilePath(); | 170 return base::FilePath(); |
| 168 } | 171 } |
| 169 | 172 |
| 170 void FakeProfile::set_last_selected_directory(const base::FilePath& path) {} | 173 void FakeProfile::set_last_selected_directory(const base::FilePath& path) {} |
| 171 | 174 |
| 172 #if defined(OS_CHROMEOS) | 175 #if defined(OS_CHROMEOS) |
| 173 void FakeProfile::ChangeAppLocale( | 176 void FakeProfile::ChangeAppLocale( |
| 174 const std::string& locale, AppLocaleChangedVia via) {} | 177 const std::string& locale, AppLocaleChangedVia via) {} |
| 175 void FakeProfile::OnLogin() {} | 178 void FakeProfile::OnLogin() {} |
| 176 void FakeProfile::InitChromeOSPreferences() {} | 179 void FakeProfile::InitChromeOSPreferences() {} |
| 177 #endif // defined(OS_CHROMEOS) | 180 #endif // defined(OS_CHROMEOS) |
| 178 | 181 |
| 179 PrefProxyConfigTracker* FakeProfile::GetProxyConfigTracker() { | 182 PrefProxyConfigTracker* FakeProfile::GetProxyConfigTracker() { |
| 180 return NULL; | 183 return nullptr; |
| 181 } | 184 } |
| 182 | 185 |
| 183 chrome_browser_net::Predictor* FakeProfile::GetNetworkPredictor() { | 186 chrome_browser_net::Predictor* FakeProfile::GetNetworkPredictor() { |
| 184 return NULL; | 187 return nullptr; |
| 185 } | 188 } |
| 186 | 189 |
| 187 DevToolsNetworkController* FakeProfile::GetDevToolsNetworkController() { | 190 DevToolsNetworkController* FakeProfile::GetDevToolsNetworkController() { |
| 188 return NULL; | 191 return nullptr; |
| 189 } | 192 } |
| 190 | 193 |
| 191 void FakeProfile::ClearNetworkingHistorySince( | 194 void FakeProfile::ClearNetworkingHistorySince( |
| 192 base::Time time, | 195 base::Time time, |
| 193 const base::Closure& completion) { | 196 const base::Closure& completion) { |
| 194 } | 197 } |
| 195 | 198 |
| 196 GURL FakeProfile::GetHomePage() { | 199 GURL FakeProfile::GetHomePage() { |
| 197 return GURL(); | 200 return GURL(); |
| 198 } | 201 } |
| 199 | 202 |
| 200 bool FakeProfile::WasCreatedByVersionOrLater(const std::string& version) { | 203 bool FakeProfile::WasCreatedByVersionOrLater(const std::string& version) { |
| 201 return false; | 204 return false; |
| 202 } | 205 } |
| 203 | 206 |
| 204 void FakeProfile::SetExitType(ExitType exit_type) { | 207 void FakeProfile::SetExitType(ExitType exit_type) { |
| 205 } | 208 } |
| 206 | 209 |
| 207 Profile::ExitType FakeProfile::GetLastSessionExitType() { | 210 Profile::ExitType FakeProfile::GetLastSessionExitType() { |
| 208 return EXIT_NORMAL; | 211 return EXIT_NORMAL; |
| 209 } | 212 } |
| OLD | NEW |