OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "chrome/test/base/testing_profile.h" | 5 #include "chrome/test/base/testing_profile.h" |
6 | 6 |
7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
8 | 8 |
9 #include "base/base_paths.h" | 9 #include "base/base_paths.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 base::Unretained(this))); | 207 base::Unretained(this))); |
208 } else { | 208 } else { |
209 FinishInit(); | 209 FinishInit(); |
210 } | 210 } |
211 } | 211 } |
212 | 212 |
213 void TestingProfile::Init() { | 213 void TestingProfile::Init() { |
214 if (!file_util::PathExists(profile_path_)) | 214 if (!file_util::PathExists(profile_path_)) |
215 file_util::CreateDirectory(profile_path_); | 215 file_util::CreateDirectory(profile_path_); |
216 | 216 |
217 ExtensionSystemFactory::GetInstance()->SetTestingFactory( | 217 extensions::ExtensionSystemFactory::GetInstance()->SetTestingFactory( |
218 this, TestExtensionSystem::Build); | 218 this, extensions::TestExtensionSystem::Build); |
219 | 219 |
220 profile_dependency_manager_->CreateProfileServices(this, true); | 220 profile_dependency_manager_->CreateProfileServices(this, true); |
221 | 221 |
222 #if defined(ENABLE_NOTIFICATIONS) | 222 #if defined(ENABLE_NOTIFICATIONS) |
223 // Install profile keyed service factory hooks for dummy/test services | 223 // Install profile keyed service factory hooks for dummy/test services |
224 DesktopNotificationServiceFactory::GetInstance()->SetTestingFactory( | 224 DesktopNotificationServiceFactory::GetInstance()->SetTestingFactory( |
225 this, CreateTestDesktopNotificationService); | 225 this, CreateTestDesktopNotificationService); |
226 #endif | 226 #endif |
227 } | 227 } |
228 | 228 |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
441 | 441 |
442 Profile* TestingProfile::GetOriginalProfile() { | 442 Profile* TestingProfile::GetOriginalProfile() { |
443 return this; | 443 return this; |
444 } | 444 } |
445 | 445 |
446 VisitedLinkMaster* TestingProfile::GetVisitedLinkMaster() { | 446 VisitedLinkMaster* TestingProfile::GetVisitedLinkMaster() { |
447 return NULL; | 447 return NULL; |
448 } | 448 } |
449 | 449 |
450 ExtensionService* TestingProfile::GetExtensionService() { | 450 ExtensionService* TestingProfile::GetExtensionService() { |
451 return ExtensionSystem::Get(this)->extension_service(); | 451 return extensions::ExtensionSystem::Get(this)->extension_service(); |
452 } | 452 } |
453 | 453 |
454 UserScriptMaster* TestingProfile::GetUserScriptMaster() { | 454 UserScriptMaster* TestingProfile::GetUserScriptMaster() { |
455 return ExtensionSystem::Get(this)->user_script_master(); | 455 return extensions::ExtensionSystem::Get(this)->user_script_master(); |
456 } | 456 } |
457 | 457 |
458 ExtensionProcessManager* TestingProfile::GetExtensionProcessManager() { | 458 ExtensionProcessManager* TestingProfile::GetExtensionProcessManager() { |
459 return ExtensionSystem::Get(this)->process_manager(); | 459 return extensions::ExtensionSystem::Get(this)->process_manager(); |
460 } | 460 } |
461 | 461 |
462 ExtensionEventRouter* TestingProfile::GetExtensionEventRouter() { | 462 ExtensionEventRouter* TestingProfile::GetExtensionEventRouter() { |
463 return ExtensionSystem::Get(this)->event_router(); | 463 return extensions::ExtensionSystem::Get(this)->event_router(); |
464 } | 464 } |
465 | 465 |
466 void TestingProfile::SetExtensionSpecialStoragePolicy( | 466 void TestingProfile::SetExtensionSpecialStoragePolicy( |
467 ExtensionSpecialStoragePolicy* extension_special_storage_policy) { | 467 ExtensionSpecialStoragePolicy* extension_special_storage_policy) { |
468 extension_special_storage_policy_ = extension_special_storage_policy; | 468 extension_special_storage_policy_ = extension_special_storage_policy; |
469 } | 469 } |
470 | 470 |
471 ExtensionSpecialStoragePolicy* | 471 ExtensionSpecialStoragePolicy* |
472 TestingProfile::GetExtensionSpecialStoragePolicy() { | 472 TestingProfile::GetExtensionSpecialStoragePolicy() { |
473 if (!extension_special_storage_policy_.get()) | 473 if (!extension_special_storage_policy_.get()) |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
545 return NULL; | 545 return NULL; |
546 } | 546 } |
547 | 547 |
548 net::URLRequestContextGetter* TestingProfile::GetRequestContext() { | 548 net::URLRequestContextGetter* TestingProfile::GetRequestContext() { |
549 return request_context_.get(); | 549 return request_context_.get(); |
550 } | 550 } |
551 | 551 |
552 net::URLRequestContextGetter* TestingProfile::GetRequestContextForRenderProcess( | 552 net::URLRequestContextGetter* TestingProfile::GetRequestContextForRenderProcess( |
553 int renderer_child_id) { | 553 int renderer_child_id) { |
554 ExtensionService* extension_service = | 554 ExtensionService* extension_service = |
555 ExtensionSystem::Get(this)->extension_service(); | 555 extensions::ExtensionSystem::Get(this)->extension_service(); |
556 if (extension_service) { | 556 if (extension_service) { |
557 const extensions::Extension* installed_app = extension_service-> | 557 const extensions::Extension* installed_app = extension_service-> |
558 GetInstalledAppForRenderer(renderer_child_id); | 558 GetInstalledAppForRenderer(renderer_child_id); |
559 if (installed_app != NULL && installed_app->is_storage_isolated()) | 559 if (installed_app != NULL && installed_app->is_storage_isolated()) |
560 return GetRequestContextForIsolatedApp(installed_app->id()); | 560 return GetRequestContextForIsolatedApp(installed_app->id()); |
561 } | 561 } |
562 | 562 |
563 return GetRequestContext(); | 563 return GetRequestContext(); |
564 } | 564 } |
565 | 565 |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
713 } | 713 } |
714 | 714 |
715 bool TestingProfile::WasCreatedByVersionOrLater(const std::string& version) { | 715 bool TestingProfile::WasCreatedByVersionOrLater(const std::string& version) { |
716 return true; | 716 return true; |
717 } | 717 } |
718 | 718 |
719 base::Callback<ChromeURLDataManagerBackend*(void)> | 719 base::Callback<ChromeURLDataManagerBackend*(void)> |
720 TestingProfile::GetChromeURLDataManagerBackendGetter() const { | 720 TestingProfile::GetChromeURLDataManagerBackendGetter() const { |
721 return base::Callback<ChromeURLDataManagerBackend*(void)>(); | 721 return base::Callback<ChromeURLDataManagerBackend*(void)>(); |
722 } | 722 } |
OLD | NEW |