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