| 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 #pragma once |    7 #pragma once | 
|    8  |    8  | 
|    9 #include "base/ref_counted.h" |    9 #include "base/ref_counted.h" | 
|   10 #include "base/scoped_ptr.h" |   10 #include "base/scoped_ptr.h" | 
|   11 #include "base/scoped_temp_dir.h" |   11 #include "base/scoped_temp_dir.h" | 
|   12 #include "base/timer.h" |   12 #include "base/timer.h" | 
|   13 #include "chrome/browser/profiles/profile.h" |   13 #include "chrome/browser/profiles/profile.h" | 
|   14  |   14  | 
|   15 namespace history { |   15 namespace history { | 
|   16 class TopSites; |   16 class TopSites; | 
|   17 } |   17 } | 
|   18  |   18  | 
|   19 namespace net { |   19 namespace net { | 
|   20 class CookieMonster; |   20 class CookieMonster; | 
|   21 } |   21 } | 
|   22  |   22  | 
|   23 class AutocompleteClassifier; |   23 class AutocompleteClassifier; | 
|   24 class BookmarkModel; |   24 class BookmarkModel; | 
|   25 class BrowserThemeProvider; |   25 class BrowserThemeProvider; | 
|   26 class CommandLine; |   26 class CommandLine; | 
|   27 class DesktopNotificationService; |   27 class DesktopNotificationService; | 
 |   28 class ExtensionPrefs; | 
|   28 class FaviconService; |   29 class FaviconService; | 
|   29 class FindBarState; |   30 class FindBarState; | 
|   30 class GeolocationContentSettingsMap; |   31 class GeolocationContentSettingsMap; | 
|   31 class GeolocationPermissionContext; |   32 class GeolocationPermissionContext; | 
|   32 class HistoryService; |   33 class HistoryService; | 
|   33 class HostContentSettingsMap; |   34 class HostContentSettingsMap; | 
|   34 class PrefService; |   35 class PrefService; | 
|   35 class ProfileSyncService; |   36 class ProfileSyncService; | 
|   36 class SessionService; |   37 class SessionService; | 
|   37 class TemplateURLModel; |   38 class TemplateURLModel; | 
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  321   TestingPrefService* testing_prefs_; |  322   TestingPrefService* testing_prefs_; | 
|  322  |  323  | 
|  323  private: |  324  private: | 
|  324   // Destroys favicon service if it has been created. |  325   // Destroys favicon service if it has been created. | 
|  325   void DestroyFaviconService(); |  326   void DestroyFaviconService(); | 
|  326  |  327  | 
|  327   // If the webdata service has been created, it is destroyed.  This is invoked |  328   // If the webdata service has been created, it is destroyed.  This is invoked | 
|  328   // from the destructor. |  329   // from the destructor. | 
|  329   void DestroyWebDataService(); |  330   void DestroyWebDataService(); | 
|  330  |  331  | 
|  331   // Creates a TestingPrefService and associates it with the TestingProfile |  332   // Creates a TestingPrefService and associates it with the TestingProfile. | 
|  332   void CreateTestingPrefService(); |  333   void CreateTestingPrefService(); | 
|  333  |  334  | 
|  334   // The favicon service. Only created if CreateFaviconService is invoked. |  335   // The favicon service. Only created if CreateFaviconService is invoked. | 
|  335   scoped_refptr<FaviconService> favicon_service_; |  336   scoped_refptr<FaviconService> favicon_service_; | 
|  336  |  337  | 
|  337   // The history service. Only created if CreateHistoryService is invoked. |  338   // The history service. Only created if CreateHistoryService is invoked. | 
|  338   scoped_refptr<HistoryService> history_service_; |  339   scoped_refptr<HistoryService> history_service_; | 
|  339  |  340  | 
|  340   // The BookmarkModel. Only created if CreateBookmarkModel is invoked. |  341   // The BookmarkModel. Only created if CreateBookmarkModel is invoked. | 
|  341   scoped_ptr<BookmarkModel> bookmark_bar_model_; |  342   scoped_ptr<BookmarkModel> bookmark_bar_model_; | 
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  397       geolocation_content_settings_map_; |  398       geolocation_content_settings_map_; | 
|  398   scoped_refptr<GeolocationPermissionContext> geolocation_permission_context_; |  399   scoped_refptr<GeolocationPermissionContext> geolocation_permission_context_; | 
|  399   scoped_ptr<DesktopNotificationService> desktop_notification_service_; |  400   scoped_ptr<DesktopNotificationService> desktop_notification_service_; | 
|  400  |  401  | 
|  401   // Find bar state.  Created lazily by GetFindBarState(). |  402   // Find bar state.  Created lazily by GetFindBarState(). | 
|  402   scoped_ptr<FindBarState> find_bar_state_; |  403   scoped_ptr<FindBarState> find_bar_state_; | 
|  403  |  404  | 
|  404   FilePath last_selected_directory_; |  405   FilePath last_selected_directory_; | 
|  405   scoped_refptr<history::TopSites> top_sites_;  // For history and thumbnails. |  406   scoped_refptr<history::TopSites> top_sites_;  // For history and thumbnails. | 
|  406  |  407  | 
 |  408   // The Extension Preferences. Only created if CreateExtensionsService is | 
 |  409   // invoked. | 
 |  410   scoped_ptr<ExtensionPrefs> extension_prefs_; | 
 |  411  | 
|  407   // For properly notifying the ExtensionsService when the profile |  412   // For properly notifying the ExtensionsService when the profile | 
|  408   // is disposed. |  413   // is disposed. | 
|  409   scoped_refptr<ExtensionsService> extensions_service_; |  414   scoped_refptr<ExtensionsService> extensions_service_; | 
|  410  |  415  | 
|  411   // The proxy prefs tracker. |  416   // The proxy prefs tracker. | 
|  412   scoped_refptr<PrefProxyConfigTracker> pref_proxy_config_tracker_; |  417   scoped_refptr<PrefProxyConfigTracker> pref_proxy_config_tracker_; | 
|  413  |  418  | 
|  414   // We use a temporary directory to store testing profile data. |  419   // We use a temporary directory to store testing profile data. | 
|  415   ScopedTempDir temp_dir_; |  420   ScopedTempDir temp_dir_; | 
|  416 }; |  421 }; | 
|  417  |  422  | 
|  418 // A profile that derives from another profile.  This does not actually |  423 // A profile that derives from another profile.  This does not actually | 
|  419 // override anything except the GetRuntimeId() in order to test sharing of |  424 // override anything except the GetRuntimeId() in order to test sharing of | 
|  420 // site information. |  425 // site information. | 
|  421 class DerivedTestingProfile : public TestingProfile { |  426 class DerivedTestingProfile : public TestingProfile { | 
|  422  public: |  427  public: | 
|  423   explicit DerivedTestingProfile(Profile* profile) |  428   explicit DerivedTestingProfile(Profile* profile) | 
|  424       : original_profile_(profile) {} |  429       : original_profile_(profile) {} | 
|  425  |  430  | 
|  426   virtual ProfileId GetRuntimeId() { |  431   virtual ProfileId GetRuntimeId() { | 
|  427     return original_profile_->GetRuntimeId(); |  432     return original_profile_->GetRuntimeId(); | 
|  428   } |  433   } | 
|  429  |  434  | 
|  430  protected: |  435  protected: | 
|  431   Profile* original_profile_; |  436   Profile* original_profile_; | 
|  432 }; |  437 }; | 
|  433  |  438  | 
|  434 #endif  // CHROME_TEST_TESTING_PROFILE_H_ |  439 #endif  // CHROME_TEST_TESTING_PROFILE_H_ | 
| OLD | NEW |