| 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 <utility> | 7 #include <utility> |
| 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 682 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 693 } | 693 } |
| 694 | 694 |
| 695 Profile* TestingProfile::GetOffTheRecordProfile() { | 695 Profile* TestingProfile::GetOffTheRecordProfile() { |
| 696 if (IsOffTheRecord()) | 696 if (IsOffTheRecord()) |
| 697 return this; | 697 return this; |
| 698 if (!incognito_profile_) | 698 if (!incognito_profile_) |
| 699 TestingProfile::Builder().BuildIncognito(this); | 699 TestingProfile::Builder().BuildIncognito(this); |
| 700 return incognito_profile_.get(); | 700 return incognito_profile_.get(); |
| 701 } | 701 } |
| 702 | 702 |
| 703 void TestingProfile::DestroyOffTheRecordProfile() { |
| 704 content::NotificationService::current()->Notify( |
| 705 chrome::NOTIFICATION_PROFILE_DESTROYED, |
| 706 content::Source<Profile>(incognito_profile_.get()), |
| 707 content::NotificationService::NoDetails()); |
| 708 incognito_profile_.reset(); |
| 709 } |
| 710 |
| 703 bool TestingProfile::HasOffTheRecordProfile() { | 711 bool TestingProfile::HasOffTheRecordProfile() { |
| 704 return incognito_profile_.get() != NULL; | 712 return incognito_profile_.get() != NULL; |
| 705 } | 713 } |
| 706 | 714 |
| 707 Profile* TestingProfile::GetOriginalProfile() { | 715 Profile* TestingProfile::GetOriginalProfile() { |
| 708 if (original_profile_) | 716 if (original_profile_) |
| 709 return original_profile_; | 717 return original_profile_; |
| 710 return this; | 718 return this; |
| 711 } | 719 } |
| 712 | 720 |
| (...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1069 // Note: Owned by |original_profile|. | 1077 // Note: Owned by |original_profile|. |
| 1070 return new TestingProfile(path_, delegate_, | 1078 return new TestingProfile(path_, delegate_, |
| 1071 #if defined(ENABLE_EXTENSIONS) | 1079 #if defined(ENABLE_EXTENSIONS) |
| 1072 extension_policy_, | 1080 extension_policy_, |
| 1073 #endif | 1081 #endif |
| 1074 std::move(pref_service_), original_profile, | 1082 std::move(pref_service_), original_profile, |
| 1075 guest_session_, supervised_user_id_, | 1083 guest_session_, supervised_user_id_, |
| 1076 std::move(policy_service_), testing_factories_, | 1084 std::move(policy_service_), testing_factories_, |
| 1077 profile_name_); | 1085 profile_name_); |
| 1078 } | 1086 } |
| OLD | NEW |