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 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
402 } | 402 } |
403 | 403 |
404 history::TopSites* TestingProfile::GetTopSites() { | 404 history::TopSites* TestingProfile::GetTopSites() { |
405 return top_sites_.get(); | 405 return top_sites_.get(); |
406 } | 406 } |
407 | 407 |
408 URLRequestContextGetter* TestingProfile::GetRequestContext() { | 408 URLRequestContextGetter* TestingProfile::GetRequestContext() { |
409 return request_context_.get(); | 409 return request_context_.get(); |
410 } | 410 } |
411 | 411 |
| 412 URLRequestContextGetter* TestingProfile::GetRequestContext( |
| 413 const Extension* app) { |
| 414 if (app != NULL && app->is_storage_isolated()) |
| 415 return GetRequestContextForIsolatedApp(app); |
| 416 |
| 417 return GetRequestContext(); |
| 418 } |
| 419 |
412 void TestingProfile::CreateRequestContext() { | 420 void TestingProfile::CreateRequestContext() { |
413 if (!request_context_) | 421 if (!request_context_) |
414 request_context_ = new TestURLRequestContextGetter(); | 422 request_context_ = new TestURLRequestContextGetter(); |
415 } | 423 } |
416 | 424 |
417 void TestingProfile::ResetRequestContext() { | 425 void TestingProfile::ResetRequestContext() { |
418 request_context_ = NULL; | 426 request_context_ = NULL; |
419 } | 427 } |
420 | 428 |
421 URLRequestContextGetter* TestingProfile::GetRequestContextForExtensions() { | 429 URLRequestContextGetter* TestingProfile::GetRequestContextForExtensions() { |
422 if (!extensions_request_context_) | 430 if (!extensions_request_context_) |
423 extensions_request_context_ = new TestExtensionURLRequestContextGetter(); | 431 extensions_request_context_ = new TestExtensionURLRequestContextGetter(); |
424 return extensions_request_context_.get(); | 432 return extensions_request_context_.get(); |
425 } | 433 } |
426 | 434 |
| 435 URLRequestContextGetter* TestingProfile::GetRequestContextForIsolatedApp( |
| 436 const Extension* installed_app) { |
| 437 // We don't test isolated app storage here yet, so returning the same dummy |
| 438 // context is sufficient for now. |
| 439 return GetRequestContext(); |
| 440 } |
| 441 |
427 FindBarState* TestingProfile::GetFindBarState() { | 442 FindBarState* TestingProfile::GetFindBarState() { |
428 if (!find_bar_state_.get()) | 443 if (!find_bar_state_.get()) |
429 find_bar_state_.reset(new FindBarState()); | 444 find_bar_state_.reset(new FindBarState()); |
430 return find_bar_state_.get(); | 445 return find_bar_state_.get(); |
431 } | 446 } |
432 | 447 |
433 HostContentSettingsMap* TestingProfile::GetHostContentSettingsMap() { | 448 HostContentSettingsMap* TestingProfile::GetHostContentSettingsMap() { |
434 if (!host_content_settings_map_.get()) | 449 if (!host_content_settings_map_.get()) |
435 host_content_settings_map_ = new HostContentSettingsMap(this); | 450 host_content_settings_map_ = new HostContentSettingsMap(this); |
436 return host_content_settings_map_.get(); | 451 return host_content_settings_map_.get(); |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
517 } | 532 } |
518 return profile_sync_service_.get(); | 533 return profile_sync_service_.get(); |
519 } | 534 } |
520 | 535 |
521 void TestingProfile::DestroyWebDataService() { | 536 void TestingProfile::DestroyWebDataService() { |
522 if (!web_data_service_.get()) | 537 if (!web_data_service_.get()) |
523 return; | 538 return; |
524 | 539 |
525 web_data_service_->Shutdown(); | 540 web_data_service_->Shutdown(); |
526 } | 541 } |
OLD | NEW |