OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #ifndef CHROME_TEST_TESTING_PROFILE_H_ | 5 #ifndef CHROME_TEST_TESTING_PROFILE_H_ |
6 #define CHROME_TEST_TESTING_PROFILE_H_ | 6 #define CHROME_TEST_TESTING_PROFILE_H_ |
7 | 7 |
8 #include "base/base_paths.h" | 8 #include "base/base_paths.h" |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
11 #include "chrome/browser/bookmarks/bookmark_model.h" | 11 #include "chrome/browser/bookmarks/bookmark_model.h" |
12 #include "chrome/browser/browser_prefs.h" | 12 #include "chrome/browser/browser_prefs.h" |
13 #include "chrome/browser/browser_theme_provider.h" | 13 #include "chrome/browser/browser_theme_provider.h" |
14 #include "chrome/browser/favicon_service.h" | 14 #include "chrome/browser/favicon_service.h" |
| 15 #include "chrome/browser/geolocation/geolocation_permission_context.h" |
15 #include "chrome/browser/host_content_settings_map.h" | 16 #include "chrome/browser/host_content_settings_map.h" |
16 #include "chrome/browser/history/history.h" | 17 #include "chrome/browser/history/history.h" |
17 #include "chrome/browser/in_process_webkit/webkit_context.h" | 18 #include "chrome/browser/in_process_webkit/webkit_context.h" |
18 #include "chrome/browser/net/url_request_context_getter.h" | 19 #include "chrome/browser/net/url_request_context_getter.h" |
19 #include "chrome/browser/pref_service.h" | 20 #include "chrome/browser/pref_service.h" |
20 #include "chrome/browser/profile.h" | 21 #include "chrome/browser/profile.h" |
21 #include "chrome/browser/search_engines/template_url_model.h" | 22 #include "chrome/browser/search_engines/template_url_model.h" |
22 #include "net/base/cookie_monster.h" | 23 #include "net/base/cookie_monster.h" |
23 | 24 |
24 class ProfileSyncFactory; | 25 class ProfileSyncFactory; |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 } | 184 } |
184 | 185 |
185 virtual net::SSLConfigService* GetSSLConfigService() { return NULL; } | 186 virtual net::SSLConfigService* GetSSLConfigService() { return NULL; } |
186 virtual Blacklist* GetPrivacyBlacklist() { return NULL; } | 187 virtual Blacklist* GetPrivacyBlacklist() { return NULL; } |
187 virtual UserStyleSheetWatcher* GetUserStyleSheetWatcher() { return NULL; } | 188 virtual UserStyleSheetWatcher* GetUserStyleSheetWatcher() { return NULL; } |
188 virtual HostContentSettingsMap* GetHostContentSettingsMap() { | 189 virtual HostContentSettingsMap* GetHostContentSettingsMap() { |
189 if (!host_content_settings_map_.get()) | 190 if (!host_content_settings_map_.get()) |
190 host_content_settings_map_ = new HostContentSettingsMap(this); | 191 host_content_settings_map_ = new HostContentSettingsMap(this); |
191 return host_content_settings_map_.get(); | 192 return host_content_settings_map_.get(); |
192 } | 193 } |
| 194 virtual GeolocationPermissionContext* GetGeolocationPermissionContext() { |
| 195 if (!geolocation_permission_context_.get()) { |
| 196 geolocation_permission_context_ = |
| 197 new GeolocationPermissionContext(GetHostContentSettingsMap()); |
| 198 } |
| 199 return geolocation_permission_context_.get(); |
| 200 } |
193 virtual HostZoomMap* GetHostZoomMap() { return NULL; } | 201 virtual HostZoomMap* GetHostZoomMap() { return NULL; } |
194 void set_session_service(SessionService* session_service); | 202 void set_session_service(SessionService* session_service); |
195 virtual SessionService* GetSessionService() { return session_service_.get(); } | 203 virtual SessionService* GetSessionService() { return session_service_.get(); } |
196 virtual void ShutdownSessionService() {} | 204 virtual void ShutdownSessionService() {} |
197 virtual bool HasSessionService() const { | 205 virtual bool HasSessionService() const { |
198 return (session_service_.get() != NULL); | 206 return (session_service_.get() != NULL); |
199 } | 207 } |
200 virtual std::wstring GetName() { return std::wstring(); } | 208 virtual std::wstring GetName() { return std::wstring(); } |
201 virtual void SetName(const std::wstring& name) {} | 209 virtual void SetName(const std::wstring& name) {} |
202 virtual std::wstring GetID() { return id_; } | 210 virtual std::wstring GetID() { return id_; } |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
308 bool last_session_exited_cleanly_; | 316 bool last_session_exited_cleanly_; |
309 | 317 |
310 // The main database tracker for this profile. | 318 // The main database tracker for this profile. |
311 // Should be used only on the file thread. | 319 // Should be used only on the file thread. |
312 scoped_refptr<webkit_database::DatabaseTracker> db_tracker_; | 320 scoped_refptr<webkit_database::DatabaseTracker> db_tracker_; |
313 | 321 |
314 // WebKitContext, lazily initialized by GetWebKitContext(). | 322 // WebKitContext, lazily initialized by GetWebKitContext(). |
315 scoped_refptr<WebKitContext> webkit_context_; | 323 scoped_refptr<WebKitContext> webkit_context_; |
316 | 324 |
317 scoped_refptr<HostContentSettingsMap> host_content_settings_map_; | 325 scoped_refptr<HostContentSettingsMap> host_content_settings_map_; |
| 326 |
| 327 scoped_refptr<GeolocationPermissionContext> geolocation_permission_context_; |
318 }; | 328 }; |
319 | 329 |
320 // A profile that derives from another profile. This does not actually | 330 // A profile that derives from another profile. This does not actually |
321 // override anything except the GetRuntimeId() in order to test sharing of | 331 // override anything except the GetRuntimeId() in order to test sharing of |
322 // site information. | 332 // site information. |
323 class DerivedTestingProfile : public TestingProfile { | 333 class DerivedTestingProfile : public TestingProfile { |
324 public: | 334 public: |
325 explicit DerivedTestingProfile(Profile* profile) | 335 explicit DerivedTestingProfile(Profile* profile) |
326 : original_profile_(profile) {} | 336 : original_profile_(profile) {} |
327 | 337 |
328 virtual ProfileId GetRuntimeId() { | 338 virtual ProfileId GetRuntimeId() { |
329 return original_profile_->GetRuntimeId(); | 339 return original_profile_->GetRuntimeId(); |
330 } | 340 } |
331 | 341 |
332 protected: | 342 protected: |
333 Profile* original_profile_; | 343 Profile* original_profile_; |
334 }; | 344 }; |
335 | 345 |
336 #endif // CHROME_TEST_TESTING_PROFILE_H_ | 346 #endif // CHROME_TEST_TESTING_PROFILE_H_ |
OLD | NEW |