| 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 "base/base_paths.h" | 7 #include "base/base_paths.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/message_loop/message_loop_proxy.h" | 10 #include "base/message_loop/message_loop_proxy.h" |
| (...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 636 } | 636 } |
| 637 | 637 |
| 638 Profile* TestingProfile::GetOffTheRecordProfile() { | 638 Profile* TestingProfile::GetOffTheRecordProfile() { |
| 639 if (IsOffTheRecord()) | 639 if (IsOffTheRecord()) |
| 640 return this; | 640 return this; |
| 641 if (!incognito_profile_) { | 641 if (!incognito_profile_) { |
| 642 TestingProfile::Builder builder; | 642 TestingProfile::Builder builder; |
| 643 builder.SetIncognito(); | 643 builder.SetIncognito(); |
| 644 scoped_ptr<TestingProfile> incognito_test_profile(builder.Build()); | 644 scoped_ptr<TestingProfile> incognito_test_profile(builder.Build()); |
| 645 incognito_test_profile->SetOriginalProfile(this); | 645 incognito_test_profile->SetOriginalProfile(this); |
| 646 incognito_test_profile->TrackZoomLevelsFromParent(this); |
| 646 SetOffTheRecordProfile(incognito_test_profile.PassAs<Profile>()); | 647 SetOffTheRecordProfile(incognito_test_profile.PassAs<Profile>()); |
| 647 } | 648 } |
| 648 return incognito_profile_.get(); | 649 return incognito_profile_.get(); |
| 649 } | 650 } |
| 650 | 651 |
| 651 bool TestingProfile::HasOffTheRecordProfile() { | 652 bool TestingProfile::HasOffTheRecordProfile() { |
| 652 return incognito_profile_.get() != NULL; | 653 return incognito_profile_.get() != NULL; |
| 653 } | 654 } |
| 654 | 655 |
| 655 Profile* TestingProfile::GetOriginalProfile() { | 656 Profile* TestingProfile::GetOriginalProfile() { |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 821 return GuestViewManager::FromBrowserContext(this); | 822 return GuestViewManager::FromBrowserContext(this); |
| 822 #else | 823 #else |
| 823 return NULL; | 824 return NULL; |
| 824 #endif | 825 #endif |
| 825 } | 826 } |
| 826 | 827 |
| 827 content::PushMessagingService* TestingProfile::GetPushMessagingService() { | 828 content::PushMessagingService* TestingProfile::GetPushMessagingService() { |
| 828 return NULL; | 829 return NULL; |
| 829 } | 830 } |
| 830 | 831 |
| 832 double TestingProfile::GetDefaultZoomLevel() const { |
| 833 return 0.0; |
| 834 } |
| 835 |
| 831 bool TestingProfile::IsSameProfile(Profile *p) { | 836 bool TestingProfile::IsSameProfile(Profile *p) { |
| 832 return this == p; | 837 return this == p; |
| 833 } | 838 } |
| 834 | 839 |
| 835 base::Time TestingProfile::GetStartTime() const { | 840 base::Time TestingProfile::GetStartTime() const { |
| 836 return start_time_; | 841 return start_time_; |
| 837 } | 842 } |
| 838 | 843 |
| 839 base::FilePath TestingProfile::last_selected_directory() { | 844 base::FilePath TestingProfile::last_selected_directory() { |
| 840 return last_selected_directory_; | 845 return last_selected_directory_; |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 980 #if defined(ENABLE_EXTENSIONS) | 985 #if defined(ENABLE_EXTENSIONS) |
| 981 extension_policy_, | 986 extension_policy_, |
| 982 #endif | 987 #endif |
| 983 pref_service_.Pass(), | 988 pref_service_.Pass(), |
| 984 incognito_, | 989 incognito_, |
| 985 guest_session_, | 990 guest_session_, |
| 986 supervised_user_id_, | 991 supervised_user_id_, |
| 987 policy_service_.Pass(), | 992 policy_service_.Pass(), |
| 988 testing_factories_)); | 993 testing_factories_)); |
| 989 } | 994 } |
| OLD | NEW |