| 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 28 matching lines...) Expand all Loading... |
| 39 #include "chrome/browser/notifications/desktop_notification_service_factory.h" | 39 #include "chrome/browser/notifications/desktop_notification_service_factory.h" |
| 40 #include "chrome/browser/policy/profile_policy_connector.h" | 40 #include "chrome/browser/policy/profile_policy_connector.h" |
| 41 #include "chrome/browser/policy/profile_policy_connector_factory.h" | 41 #include "chrome/browser/policy/profile_policy_connector_factory.h" |
| 42 #include "chrome/browser/prefs/browser_prefs.h" | 42 #include "chrome/browser/prefs/browser_prefs.h" |
| 43 #include "chrome/browser/prefs/pref_service_syncable.h" | 43 #include "chrome/browser/prefs/pref_service_syncable.h" |
| 44 #include "chrome/browser/prerender/prerender_manager.h" | 44 #include "chrome/browser/prerender/prerender_manager.h" |
| 45 #include "chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.h" | 45 #include "chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.h" |
| 46 #include "chrome/browser/profiles/profile_manager.h" | 46 #include "chrome/browser/profiles/profile_manager.h" |
| 47 #include "chrome/browser/profiles/storage_partition_descriptor.h" | 47 #include "chrome/browser/profiles/storage_partition_descriptor.h" |
| 48 #include "chrome/browser/search_engines/template_url_fetcher_factory.h" | 48 #include "chrome/browser/search_engines/template_url_fetcher_factory.h" |
| 49 #include "chrome/browser/wake_lock/chrome_wake_lock_permission_context.h" |
| 50 #include "chrome/browser/wake_lock/chrome_wake_lock_permission_context_factory.h
" |
| 49 #include "chrome/browser/webdata/web_data_service_factory.h" | 51 #include "chrome/browser/webdata/web_data_service_factory.h" |
| 50 #include "chrome/common/chrome_constants.h" | 52 #include "chrome/common/chrome_constants.h" |
| 51 #include "chrome/common/chrome_switches.h" | 53 #include "chrome/common/chrome_switches.h" |
| 52 #include "chrome/common/pref_names.h" | 54 #include "chrome/common/pref_names.h" |
| 53 #include "chrome/common/url_constants.h" | 55 #include "chrome/common/url_constants.h" |
| 54 #include "chrome/test/base/history_index_restore_observer.h" | 56 #include "chrome/test/base/history_index_restore_observer.h" |
| 55 #include "chrome/test/base/testing_pref_service_syncable.h" | 57 #include "chrome/test/base/testing_pref_service_syncable.h" |
| 56 #include "chrome/test/base/ui_test_utils.h" | 58 #include "chrome/test/base/ui_test_utils.h" |
| 57 #include "components/bookmarks/browser/bookmark_model.h" | 59 #include "components/bookmarks/browser/bookmark_model.h" |
| 58 #include "components/bookmarks/common/bookmark_constants.h" | 60 #include "components/bookmarks/common/bookmark_constants.h" |
| (...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 596 if (!prefs_.get()) | 598 if (!prefs_.get()) |
| 597 CreateTestingPrefService(); | 599 CreateTestingPrefService(); |
| 598 DCHECK(testing_prefs_); | 600 DCHECK(testing_prefs_); |
| 599 return testing_prefs_; | 601 return testing_prefs_; |
| 600 } | 602 } |
| 601 | 603 |
| 602 TestingProfile* TestingProfile::AsTestingProfile() { | 604 TestingProfile* TestingProfile::AsTestingProfile() { |
| 603 return this; | 605 return this; |
| 604 } | 606 } |
| 605 | 607 |
| 608 content::WakeLockPermissionContext* |
| 609 TestingProfile::GetWakeLockPermissionContext() { |
| 610 #if defined(OS_IOS) |
| 611 return NULL; |
| 612 #endif |
| 613 return ChromeWakeLockPermissionContextFactory::GetForProfile(this); |
| 614 } |
| 615 |
| 606 std::string TestingProfile::GetProfileName() { | 616 std::string TestingProfile::GetProfileName() { |
| 607 return profile_name_; | 617 return profile_name_; |
| 608 } | 618 } |
| 609 | 619 |
| 610 Profile::ProfileType TestingProfile::GetProfileType() const { | 620 Profile::ProfileType TestingProfile::GetProfileType() const { |
| 611 if (guest_session_) | 621 if (guest_session_) |
| 612 return GUEST_PROFILE; | 622 return GUEST_PROFILE; |
| 613 if (force_incognito_ || incognito_) | 623 if (force_incognito_ || incognito_) |
| 614 return INCOGNITO_PROFILE; | 624 return INCOGNITO_PROFILE; |
| 615 return REGULAR_PROFILE; | 625 return REGULAR_PROFILE; |
| (...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 953 path_, | 963 path_, |
| 954 delegate_, | 964 delegate_, |
| 955 extension_policy_, | 965 extension_policy_, |
| 956 pref_service_.Pass(), | 966 pref_service_.Pass(), |
| 957 incognito_, | 967 incognito_, |
| 958 guest_session_, | 968 guest_session_, |
| 959 supervised_user_id_, | 969 supervised_user_id_, |
| 960 policy_service_.Pass(), | 970 policy_service_.Pass(), |
| 961 testing_factories_)); | 971 testing_factories_)); |
| 962 } | 972 } |
| OLD | NEW |