| 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/sync/test/integration/sync_app_helper.h" | 5 #include "chrome/browser/sync/test/integration/sync_app_helper.h" |
| 6 | 6 |
| 7 #include "chrome/browser/extensions/extension_service.h" | 7 #include "chrome/browser/extensions/extension_service.h" |
| 8 #include "chrome/browser/extensions/launch_util.h" | 8 #include "chrome/browser/extensions/launch_util.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/sync/test/integration/extensions_helper.h" | 10 #include "chrome/browser/sync/test/integration/extensions_helper.h" |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 app_state->description = extension->description(); | 82 app_state->description = extension->description(); |
| 83 app_state->name = extension->name(); | 83 app_state->name = extension->name(); |
| 84 app_state->from_bookmark = extension->from_bookmark(); | 84 app_state->from_bookmark = extension->from_bookmark(); |
| 85 } | 85 } |
| 86 } | 86 } |
| 87 | 87 |
| 88 // Returns a map from |profile|'s installed extensions to their state. | 88 // Returns a map from |profile|'s installed extensions to their state. |
| 89 AppStateMap GetAppStates(Profile* profile) { | 89 AppStateMap GetAppStates(Profile* profile) { |
| 90 AppStateMap app_state_map; | 90 AppStateMap app_state_map; |
| 91 | 91 |
| 92 scoped_ptr<const extensions::ExtensionSet> extensions( | 92 std::unique_ptr<const extensions::ExtensionSet> extensions( |
| 93 extensions::ExtensionRegistry::Get(profile) | 93 extensions::ExtensionRegistry::Get(profile) |
| 94 ->GenerateInstalledExtensionsSet()); | 94 ->GenerateInstalledExtensionsSet()); |
| 95 for (const auto& extension : *extensions) { | 95 for (const auto& extension : *extensions) { |
| 96 if (extension->is_app() && | 96 if (extension->is_app() && |
| 97 extensions::sync_helper::IsSyncable(extension.get())) { | 97 extensions::sync_helper::IsSyncable(extension.get())) { |
| 98 const std::string& id = extension->id(); | 98 const std::string& id = extension->id(); |
| 99 LoadApp(profile, id, &(app_state_map[id])); | 99 LoadApp(profile, id, &(app_state_map[id])); |
| 100 } | 100 } |
| 101 } | 101 } |
| 102 | 102 |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 crx_file::id_util::GenerateId(name), app_launch_ordinal); | 213 crx_file::id_util::GenerateId(name), app_launch_ordinal); |
| 214 } | 214 } |
| 215 | 215 |
| 216 void SyncAppHelper::FixNTPOrdinalCollisions(Profile* profile) { | 216 void SyncAppHelper::FixNTPOrdinalCollisions(Profile* profile) { |
| 217 ExtensionSystem::Get(profile)->app_sorting()->FixNTPOrdinalCollisions(); | 217 ExtensionSystem::Get(profile)->app_sorting()->FixNTPOrdinalCollisions(); |
| 218 } | 218 } |
| 219 | 219 |
| 220 SyncAppHelper::SyncAppHelper() : setup_completed_(false) {} | 220 SyncAppHelper::SyncAppHelper() : setup_completed_(false) {} |
| 221 | 221 |
| 222 SyncAppHelper::~SyncAppHelper() {} | 222 SyncAppHelper::~SyncAppHelper() {} |
| OLD | NEW |