| 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" |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 virtual void set_last_selected_directory(const FilePath& path) { | 287 virtual void set_last_selected_directory(const FilePath& path) { |
| 288 last_selected_directory_ = path; | 288 last_selected_directory_ = path; |
| 289 } | 289 } |
| 290 #if defined(OS_CHROMEOS) | 290 #if defined(OS_CHROMEOS) |
| 291 virtual chromeos::ProxyConfigServiceImpl* | 291 virtual chromeos::ProxyConfigServiceImpl* |
| 292 GetChromeOSProxyConfigServiceImpl() { | 292 GetChromeOSProxyConfigServiceImpl() { |
| 293 return NULL; | 293 return NULL; |
| 294 } | 294 } |
| 295 #endif // defined(OS_CHROMEOS) | 295 #endif // defined(OS_CHROMEOS) |
| 296 | 296 |
| 297 virtual PrefProxyConfigTracker* GetProxyConfigTracker(); |
| 298 |
| 297 // Schedules a task on the history backend and runs a nested loop until the | 299 // Schedules a task on the history backend and runs a nested loop until the |
| 298 // task is processed. This has the effect of blocking the caller until the | 300 // task is processed. This has the effect of blocking the caller until the |
| 299 // history service processes all pending requests. | 301 // history service processes all pending requests. |
| 300 void BlockUntilHistoryProcessesPendingRequests(); | 302 void BlockUntilHistoryProcessesPendingRequests(); |
| 301 | 303 |
| 302 // Creates and initializes a profile sync service if the tests require one. | 304 // Creates and initializes a profile sync service if the tests require one. |
| 303 virtual TokenService* GetTokenService(); | 305 virtual TokenService* GetTokenService(); |
| 304 virtual ProfileSyncService* GetProfileSyncService(); | 306 virtual ProfileSyncService* GetProfileSyncService(); |
| 305 virtual ProfileSyncService* GetProfileSyncService( | 307 virtual ProfileSyncService* GetProfileSyncService( |
| 306 const std::string& cros_notes); | 308 const std::string& cros_notes); |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 397 // Find bar state. Created lazily by GetFindBarState(). | 399 // Find bar state. Created lazily by GetFindBarState(). |
| 398 scoped_ptr<FindBarState> find_bar_state_; | 400 scoped_ptr<FindBarState> find_bar_state_; |
| 399 | 401 |
| 400 FilePath last_selected_directory_; | 402 FilePath last_selected_directory_; |
| 401 scoped_refptr<history::TopSites> top_sites_; // For history and thumbnails. | 403 scoped_refptr<history::TopSites> top_sites_; // For history and thumbnails. |
| 402 | 404 |
| 403 // For properly notifying the ExtensionsService when the profile | 405 // For properly notifying the ExtensionsService when the profile |
| 404 // is disposed. | 406 // is disposed. |
| 405 scoped_refptr<ExtensionsService> extensions_service_; | 407 scoped_refptr<ExtensionsService> extensions_service_; |
| 406 | 408 |
| 409 // The proxy prefs tracker. |
| 410 scoped_refptr<PrefProxyConfigTracker> pref_proxy_config_tracker_; |
| 411 |
| 407 // We use a temporary directory to store testing profile data. | 412 // We use a temporary directory to store testing profile data. |
| 408 ScopedTempDir temp_dir_; | 413 ScopedTempDir temp_dir_; |
| 409 }; | 414 }; |
| 410 | 415 |
| 411 // A profile that derives from another profile. This does not actually | 416 // A profile that derives from another profile. This does not actually |
| 412 // override anything except the GetRuntimeId() in order to test sharing of | 417 // override anything except the GetRuntimeId() in order to test sharing of |
| 413 // site information. | 418 // site information. |
| 414 class DerivedTestingProfile : public TestingProfile { | 419 class DerivedTestingProfile : public TestingProfile { |
| 415 public: | 420 public: |
| 416 explicit DerivedTestingProfile(Profile* profile) | 421 explicit DerivedTestingProfile(Profile* profile) |
| 417 : original_profile_(profile) {} | 422 : original_profile_(profile) {} |
| 418 | 423 |
| 419 virtual ProfileId GetRuntimeId() { | 424 virtual ProfileId GetRuntimeId() { |
| 420 return original_profile_->GetRuntimeId(); | 425 return original_profile_->GetRuntimeId(); |
| 421 } | 426 } |
| 422 | 427 |
| 423 protected: | 428 protected: |
| 424 Profile* original_profile_; | 429 Profile* original_profile_; |
| 425 }; | 430 }; |
| 426 | 431 |
| 427 #endif // CHROME_TEST_TESTING_PROFILE_H_ | 432 #endif // CHROME_TEST_TESTING_PROFILE_H_ |
| OLD | NEW |