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