| 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/browser/profiles/profile_dependency_manager.h" | 5 #include "chrome/browser/profiles/profile_dependency_manager.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <deque> | 8 #include <deque> |
| 9 #include <iterator> | 9 #include <iterator> |
| 10 | 10 |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 for (std::vector<ProfileKeyedBaseFactory*>::reverse_iterator rit = | 95 for (std::vector<ProfileKeyedBaseFactory*>::reverse_iterator rit = |
| 96 destruction_order_.rbegin(); rit != destruction_order_.rend(); | 96 destruction_order_.rbegin(); rit != destruction_order_.rend(); |
| 97 ++rit) { | 97 ++rit) { |
| 98 if (!profile->IsOffTheRecord()) { | 98 if (!profile->IsOffTheRecord()) { |
| 99 // We only register preferences on normal profiles because the incognito | 99 // We only register preferences on normal profiles because the incognito |
| 100 // profile shares the pref service with the normal one. | 100 // profile shares the pref service with the normal one. |
| 101 (*rit)->RegisterUserPrefsOnProfile(profile); | 101 (*rit)->RegisterUserPrefsOnProfile(profile); |
| 102 } | 102 } |
| 103 | 103 |
| 104 if (is_testing_profile && (*rit)->ServiceIsNULLWhileTesting()) { | 104 if (is_testing_profile && (*rit)->ServiceIsNULLWhileTesting()) { |
| 105 (*rit)->SetTestingFactory(profile, NULL); | 105 (*rit)->SetEmptyTestingFactory(profile); |
| 106 } else if ((*rit)->ServiceIsCreatedWithProfile()) { | 106 } else if ((*rit)->ServiceIsCreatedWithProfile()) { |
| 107 // Create the service. | 107 // Create the service. |
| 108 (*rit)->GetBaseForProfile(profile, true); | 108 (*rit)->CreateServiceNow(profile); |
| 109 } | 109 } |
| 110 } | 110 } |
| 111 } | 111 } |
| 112 | 112 |
| 113 void ProfileDependencyManager::DestroyProfileServices(Profile* profile) { | 113 void ProfileDependencyManager::DestroyProfileServices(Profile* profile) { |
| 114 if (destruction_order_.empty()) | 114 if (destruction_order_.empty()) |
| 115 BuildDestructionOrder(profile); | 115 BuildDestructionOrder(profile); |
| 116 | 116 |
| 117 for (std::vector<ProfileKeyedBaseFactory*>::const_iterator it = | 117 for (std::vector<ProfileKeyedBaseFactory*>::const_iterator it = |
| 118 destruction_order_.begin(); it != destruction_order_.end(); ++it) { | 118 destruction_order_.begin(); it != destruction_order_.end(); ++it) { |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 } | 303 } |
| 304 | 304 |
| 305 result.append("\n /* Toplevel profile */\n"); | 305 result.append("\n /* Toplevel profile */\n"); |
| 306 result.append(" Profile [shape=box];\n"); | 306 result.append(" Profile [shape=box];\n"); |
| 307 | 307 |
| 308 result.append("}\n"); | 308 result.append("}\n"); |
| 309 return result; | 309 return result; |
| 310 } | 310 } |
| 311 | 311 |
| 312 #endif | 312 #endif |
| OLD | NEW |