| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 // recreating the BookmarkModel. | 77 // recreating the BookmarkModel. |
| 78 // | 78 // |
| 79 // NOTE: this does not block until the bookmarks are loaded. For that use | 79 // NOTE: this does not block until the bookmarks are loaded. For that use |
| 80 // BlockUntilBookmarkModelLoaded. | 80 // BlockUntilBookmarkModelLoaded. |
| 81 void CreateBookmarkModel(bool delete_file); | 81 void CreateBookmarkModel(bool delete_file); |
| 82 | 82 |
| 83 // Creates an AutocompleteClassifier. If not invoked the | 83 // Creates an AutocompleteClassifier. If not invoked the |
| 84 // AutocompleteClassifier is NULL. | 84 // AutocompleteClassifier is NULL. |
| 85 void CreateAutocompleteClassifier(); | 85 void CreateAutocompleteClassifier(); |
| 86 | 86 |
| 87 // Creates a ProtocolHandlerRegistry. If not invoked the protocol handler |
| 88 // registry is NULL. |
| 89 void CreateProtocolHandlerRegistry(); |
| 90 |
| 87 // Creates the webdata service. If |delete_file| is true, the webdata file is | 91 // Creates the webdata service. If |delete_file| is true, the webdata file is |
| 88 // deleted first, then the WebDataService is created. As TestingProfile | 92 // deleted first, then the WebDataService is created. As TestingProfile |
| 89 // deletes the directory containing the files used by WebDataService, this | 93 // deletes the directory containing the files used by WebDataService, this |
| 90 // only matters if you're recreating the WebDataService. | 94 // only matters if you're recreating the WebDataService. |
| 91 void CreateWebDataService(bool delete_file); | 95 void CreateWebDataService(bool delete_file); |
| 92 | 96 |
| 93 // Blocks until the BookmarkModel finishes loaded. This is NOT invoked from | 97 // Blocks until the BookmarkModel finishes loaded. This is NOT invoked from |
| 94 // CreateBookmarkModel. | 98 // CreateBookmarkModel. |
| 95 void BlockUntilBookmarkModelLoaded(); | 99 void BlockUntilBookmarkModelLoaded(); |
| 96 | 100 |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 virtual bool DidLastSessionExitCleanly() { | 263 virtual bool DidLastSessionExitCleanly() { |
| 260 return last_session_exited_cleanly_; | 264 return last_session_exited_cleanly_; |
| 261 } | 265 } |
| 262 virtual void MergeResourceString(int message_id, | 266 virtual void MergeResourceString(int message_id, |
| 263 std::wstring* output_string) {} | 267 std::wstring* output_string) {} |
| 264 virtual void MergeResourceInteger(int message_id, int* output_value) {} | 268 virtual void MergeResourceInteger(int message_id, int* output_value) {} |
| 265 virtual void MergeResourceBoolean(int message_id, bool* output_value) {} | 269 virtual void MergeResourceBoolean(int message_id, bool* output_value) {} |
| 266 virtual BookmarkModel* GetBookmarkModel() { | 270 virtual BookmarkModel* GetBookmarkModel() { |
| 267 return bookmark_bar_model_.get(); | 271 return bookmark_bar_model_.get(); |
| 268 } | 272 } |
| 273 virtual ProtocolHandlerRegistry* GetProtocolHandlerRegistry() { |
| 274 return protocol_handler_registry_.get(); |
| 275 } |
| 269 virtual bool IsSameProfile(Profile *p) { return this == p; } | 276 virtual bool IsSameProfile(Profile *p) { return this == p; } |
| 270 virtual base::Time GetStartTime() const { return start_time_; } | 277 virtual base::Time GetStartTime() const { return start_time_; } |
| 271 virtual TabRestoreService* GetTabRestoreService() { return NULL; } | 278 virtual TabRestoreService* GetTabRestoreService() { return NULL; } |
| 272 virtual void ResetTabRestoreService() {} | 279 virtual void ResetTabRestoreService() {} |
| 273 virtual SpellCheckHost* GetSpellCheckHost() { return NULL; } | 280 virtual SpellCheckHost* GetSpellCheckHost() { return NULL; } |
| 274 virtual void ReinitializeSpellCheckHost(bool force) { } | 281 virtual void ReinitializeSpellCheckHost(bool force) { } |
| 275 virtual WebKitContext* GetWebKitContext(); | 282 virtual WebKitContext* GetWebKitContext(); |
| 276 virtual WebKitContext* GetOffTheRecordWebKitContext() { return NULL; } | 283 virtual WebKitContext* GetOffTheRecordWebKitContext() { return NULL; } |
| 277 virtual void MarkAsCleanShutdown() {} | 284 virtual void MarkAsCleanShutdown() {} |
| 278 virtual void InitExtensions() {} | 285 virtual void InitExtensions() {} |
| 279 virtual void InitWebResources() {} | 286 virtual void InitWebResources() {} |
| 287 virtual void InitRegisteredProtocolHandlers() {} |
| 280 virtual NTPResourceCache* GetNTPResourceCache(); | 288 virtual NTPResourceCache* GetNTPResourceCache(); |
| 281 | 289 |
| 282 virtual DesktopNotificationService* GetDesktopNotificationService(); | 290 virtual DesktopNotificationService* GetDesktopNotificationService(); |
| 283 virtual BackgroundContentsService* GetBackgroundContentsService() const { | 291 virtual BackgroundContentsService* GetBackgroundContentsService() const { |
| 284 return NULL; | 292 return NULL; |
| 285 } | 293 } |
| 286 virtual StatusTray* GetStatusTray() { | 294 virtual StatusTray* GetStatusTray() { |
| 287 return NULL; | 295 return NULL; |
| 288 } | 296 } |
| 289 virtual FilePath last_selected_directory() { | 297 virtual FilePath last_selected_directory() { |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 | 350 |
| 343 // The favicon service. Only created if CreateFaviconService is invoked. | 351 // The favicon service. Only created if CreateFaviconService is invoked. |
| 344 scoped_refptr<FaviconService> favicon_service_; | 352 scoped_refptr<FaviconService> favicon_service_; |
| 345 | 353 |
| 346 // The history service. Only created if CreateHistoryService is invoked. | 354 // The history service. Only created if CreateHistoryService is invoked. |
| 347 scoped_refptr<HistoryService> history_service_; | 355 scoped_refptr<HistoryService> history_service_; |
| 348 | 356 |
| 349 // The BookmarkModel. Only created if CreateBookmarkModel is invoked. | 357 // The BookmarkModel. Only created if CreateBookmarkModel is invoked. |
| 350 scoped_ptr<BookmarkModel> bookmark_bar_model_; | 358 scoped_ptr<BookmarkModel> bookmark_bar_model_; |
| 351 | 359 |
| 360 // The ProtocolHandlerRegistry. Only created if CreateProtocolHandlerRegistry |
| 361 // is invoked. |
| 362 scoped_refptr<ProtocolHandlerRegistry> protocol_handler_registry_; |
| 363 |
| 352 // The TokenService. Created by CreateTokenService. Filled with dummy data. | 364 // The TokenService. Created by CreateTokenService. Filled with dummy data. |
| 353 scoped_ptr<TokenService> token_service_; | 365 scoped_ptr<TokenService> token_service_; |
| 354 | 366 |
| 355 // The ProfileSyncService. Created by CreateProfileSyncService. | 367 // The ProfileSyncService. Created by CreateProfileSyncService. |
| 356 scoped_ptr<ProfileSyncService> profile_sync_service_; | 368 scoped_ptr<ProfileSyncService> profile_sync_service_; |
| 357 | 369 |
| 358 // The AutocompleteClassifier. Only created if CreateAutocompleteClassifier | 370 // The AutocompleteClassifier. Only created if CreateAutocompleteClassifier |
| 359 // is invoked. | 371 // is invoked. |
| 360 scoped_ptr<AutocompleteClassifier> autocomplete_classifier_; | 372 scoped_ptr<AutocompleteClassifier> autocomplete_classifier_; |
| 361 | 373 |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 440 | 452 |
| 441 virtual ProfileId GetRuntimeId() { | 453 virtual ProfileId GetRuntimeId() { |
| 442 return original_profile_->GetRuntimeId(); | 454 return original_profile_->GetRuntimeId(); |
| 443 } | 455 } |
| 444 | 456 |
| 445 protected: | 457 protected: |
| 446 Profile* original_profile_; | 458 Profile* original_profile_; |
| 447 }; | 459 }; |
| 448 | 460 |
| 449 #endif // CHROME_TEST_TESTING_PROFILE_H_ | 461 #endif // CHROME_TEST_TESTING_PROFILE_H_ |
| OLD | NEW |