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