| 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 #include "chrome/test/testing_profile.h" | 5 #include "chrome/test/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 544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 555 } | 555 } |
| 556 | 556 |
| 557 bool TestingProfile::HasCreatedDownloadManager() const { | 557 bool TestingProfile::HasCreatedDownloadManager() const { |
| 558 return false; | 558 return false; |
| 559 } | 559 } |
| 560 | 560 |
| 561 URLRequestContextGetter* TestingProfile::GetRequestContext() { | 561 URLRequestContextGetter* TestingProfile::GetRequestContext() { |
| 562 return request_context_.get(); | 562 return request_context_.get(); |
| 563 } | 563 } |
| 564 | 564 |
| 565 URLRequestContextGetter* TestingProfile::GetRequestContextForPossibleApp( |
| 566 const Extension* installed_app) { |
| 567 if (installed_app != NULL && installed_app->is_storage_isolated()) |
| 568 return GetRequestContextForIsolatedApp(installed_app); |
| 569 |
| 570 return GetRequestContext(); |
| 571 } |
| 572 |
| 565 void TestingProfile::CreateRequestContext() { | 573 void TestingProfile::CreateRequestContext() { |
| 566 if (!request_context_) | 574 if (!request_context_) |
| 567 request_context_ = new TestURLRequestContextGetter(); | 575 request_context_ = new TestURLRequestContextGetter(); |
| 568 } | 576 } |
| 569 | 577 |
| 570 void TestingProfile::ResetRequestContext() { | 578 void TestingProfile::ResetRequestContext() { |
| 571 request_context_ = NULL; | 579 request_context_ = NULL; |
| 572 } | 580 } |
| 573 | 581 |
| 574 URLRequestContextGetter* TestingProfile::GetRequestContextForMedia() { | 582 URLRequestContextGetter* TestingProfile::GetRequestContextForMedia() { |
| 575 return NULL; | 583 return NULL; |
| 576 } | 584 } |
| 577 | 585 |
| 578 URLRequestContextGetter* TestingProfile::GetRequestContextForExtensions() { | 586 URLRequestContextGetter* TestingProfile::GetRequestContextForExtensions() { |
| 579 if (!extensions_request_context_) | 587 if (!extensions_request_context_) |
| 580 extensions_request_context_ = new TestExtensionURLRequestContextGetter(); | 588 extensions_request_context_ = new TestExtensionURLRequestContextGetter(); |
| 581 return extensions_request_context_.get(); | 589 return extensions_request_context_.get(); |
| 582 } | 590 } |
| 583 | 591 |
| 584 net::SSLConfigService* TestingProfile::GetSSLConfigService() { | 592 net::SSLConfigService* TestingProfile::GetSSLConfigService() { |
| 585 return NULL; | 593 return NULL; |
| 586 } | 594 } |
| 587 | 595 |
| 588 UserStyleSheetWatcher* TestingProfile::GetUserStyleSheetWatcher() { | 596 UserStyleSheetWatcher* TestingProfile::GetUserStyleSheetWatcher() { |
| 589 return NULL; | 597 return NULL; |
| 590 } | 598 } |
| 591 | 599 |
| 600 URLRequestContextGetter* TestingProfile::GetRequestContextForIsolatedApp( |
| 601 const Extension* installed_app) { |
| 602 // We don't test isolated app storage here yet, so returning the same dummy |
| 603 // context is sufficient for now. |
| 604 return GetRequestContext(); |
| 605 } |
| 606 |
| 592 FindBarState* TestingProfile::GetFindBarState() { | 607 FindBarState* TestingProfile::GetFindBarState() { |
| 593 if (!find_bar_state_.get()) | 608 if (!find_bar_state_.get()) |
| 594 find_bar_state_.reset(new FindBarState()); | 609 find_bar_state_.reset(new FindBarState()); |
| 595 return find_bar_state_.get(); | 610 return find_bar_state_.get(); |
| 596 } | 611 } |
| 597 | 612 |
| 598 HostContentSettingsMap* TestingProfile::GetHostContentSettingsMap() { | 613 HostContentSettingsMap* TestingProfile::GetHostContentSettingsMap() { |
| 599 if (!host_content_settings_map_.get()) | 614 if (!host_content_settings_map_.get()) |
| 600 host_content_settings_map_ = new HostContentSettingsMap(this); | 615 host_content_settings_map_ = new HostContentSettingsMap(this); |
| 601 return host_content_settings_map_.get(); | 616 return host_content_settings_map_.get(); |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 802 } | 817 } |
| 803 | 818 |
| 804 DerivedTestingProfile::DerivedTestingProfile(Profile* profile) | 819 DerivedTestingProfile::DerivedTestingProfile(Profile* profile) |
| 805 : original_profile_(profile) {} | 820 : original_profile_(profile) {} |
| 806 | 821 |
| 807 DerivedTestingProfile::~DerivedTestingProfile() {} | 822 DerivedTestingProfile::~DerivedTestingProfile() {} |
| 808 | 823 |
| 809 ProfileId DerivedTestingProfile::GetRuntimeId() { | 824 ProfileId DerivedTestingProfile::GetRuntimeId() { |
| 810 return original_profile_->GetRuntimeId(); | 825 return original_profile_->GetRuntimeId(); |
| 811 } | 826 } |
| OLD | NEW |