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_content_settings_map.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 PersonalDataManager; | 25 class PersonalDataManager; |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 } | 191 } |
191 | 192 |
192 virtual net::SSLConfigService* GetSSLConfigService() { return NULL; } | 193 virtual net::SSLConfigService* GetSSLConfigService() { return NULL; } |
193 virtual Blacklist* GetPrivacyBlacklist() { return NULL; } | 194 virtual Blacklist* GetPrivacyBlacklist() { return NULL; } |
194 virtual UserStyleSheetWatcher* GetUserStyleSheetWatcher() { return NULL; } | 195 virtual UserStyleSheetWatcher* GetUserStyleSheetWatcher() { return NULL; } |
195 virtual HostContentSettingsMap* GetHostContentSettingsMap() { | 196 virtual HostContentSettingsMap* GetHostContentSettingsMap() { |
196 if (!host_content_settings_map_.get()) | 197 if (!host_content_settings_map_.get()) |
197 host_content_settings_map_ = new HostContentSettingsMap(this); | 198 host_content_settings_map_ = new HostContentSettingsMap(this); |
198 return host_content_settings_map_.get(); | 199 return host_content_settings_map_.get(); |
199 } | 200 } |
| 201 virtual GeolocationContentSettingsMap* GetGeolocationContentSettingsMap() { |
| 202 if (!geolocation_content_settings_map_.get()) { |
| 203 geolocation_content_settings_map_ = |
| 204 new GeolocationContentSettingsMap(this); |
| 205 } |
| 206 return geolocation_content_settings_map_.get(); |
| 207 } |
200 virtual HostZoomMap* GetHostZoomMap() { return NULL; } | 208 virtual HostZoomMap* GetHostZoomMap() { return NULL; } |
201 void set_session_service(SessionService* session_service); | 209 void set_session_service(SessionService* session_service); |
202 virtual SessionService* GetSessionService() { return session_service_.get(); } | 210 virtual SessionService* GetSessionService() { return session_service_.get(); } |
203 virtual void ShutdownSessionService() {} | 211 virtual void ShutdownSessionService() {} |
204 virtual bool HasSessionService() const { | 212 virtual bool HasSessionService() const { |
205 return (session_service_.get() != NULL); | 213 return (session_service_.get() != NULL); |
206 } | 214 } |
207 virtual std::wstring GetName() { return std::wstring(); } | 215 virtual std::wstring GetName() { return std::wstring(); } |
208 virtual void SetName(const std::wstring& name) {} | 216 virtual void SetName(const std::wstring& name) {} |
209 virtual std::wstring GetID() { return id_; } | 217 virtual std::wstring GetID() { return id_; } |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 bool last_session_exited_cleanly_; | 327 bool last_session_exited_cleanly_; |
320 | 328 |
321 // The main database tracker for this profile. | 329 // The main database tracker for this profile. |
322 // Should be used only on the file thread. | 330 // Should be used only on the file thread. |
323 scoped_refptr<webkit_database::DatabaseTracker> db_tracker_; | 331 scoped_refptr<webkit_database::DatabaseTracker> db_tracker_; |
324 | 332 |
325 // WebKitContext, lazily initialized by GetWebKitContext(). | 333 // WebKitContext, lazily initialized by GetWebKitContext(). |
326 scoped_refptr<WebKitContext> webkit_context_; | 334 scoped_refptr<WebKitContext> webkit_context_; |
327 | 335 |
328 scoped_refptr<HostContentSettingsMap> host_content_settings_map_; | 336 scoped_refptr<HostContentSettingsMap> host_content_settings_map_; |
| 337 scoped_refptr<GeolocationContentSettingsMap> |
| 338 geolocation_content_settings_map_; |
329 }; | 339 }; |
330 | 340 |
331 // A profile that derives from another profile. This does not actually | 341 // A profile that derives from another profile. This does not actually |
332 // override anything except the GetRuntimeId() in order to test sharing of | 342 // override anything except the GetRuntimeId() in order to test sharing of |
333 // site information. | 343 // site information. |
334 class DerivedTestingProfile : public TestingProfile { | 344 class DerivedTestingProfile : public TestingProfile { |
335 public: | 345 public: |
336 explicit DerivedTestingProfile(Profile* profile) | 346 explicit DerivedTestingProfile(Profile* profile) |
337 : original_profile_(profile) {} | 347 : original_profile_(profile) {} |
338 | 348 |
339 virtual ProfileId GetRuntimeId() { | 349 virtual ProfileId GetRuntimeId() { |
340 return original_profile_->GetRuntimeId(); | 350 return original_profile_->GetRuntimeId(); |
341 } | 351 } |
342 | 352 |
343 protected: | 353 protected: |
344 Profile* original_profile_; | 354 Profile* original_profile_; |
345 }; | 355 }; |
346 | 356 |
347 #endif // CHROME_TEST_TESTING_PROFILE_H_ | 357 #endif // CHROME_TEST_TESTING_PROFILE_H_ |
OLD | NEW |