| 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/apps_helper.h" | 5 #include "chrome/browser/sync/test/integration/apps_helper.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/string_number_conversions.h" | 8 #include "base/string_number_conversions.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/sync/test/integration/sync_app_helper.h" | 10 #include "chrome/browser/sync/test/integration/sync_app_helper.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 return true; | 40 return true; |
| 41 } | 41 } |
| 42 | 42 |
| 43 std::string InstallApp(Profile* profile, int index) { | 43 std::string InstallApp(Profile* profile, int index) { |
| 44 return SyncExtensionHelper::GetInstance()->InstallExtension( | 44 return SyncExtensionHelper::GetInstance()->InstallExtension( |
| 45 profile, | 45 profile, |
| 46 CreateFakeAppName(index), | 46 CreateFakeAppName(index), |
| 47 extensions::Extension::TYPE_HOSTED_APP); | 47 extensions::Extension::TYPE_HOSTED_APP); |
| 48 } | 48 } |
| 49 | 49 |
| 50 std::string InstallPlatformApp(Profile* profile, int index) { |
| 51 return SyncExtensionHelper::GetInstance()->InstallExtension( |
| 52 profile, |
| 53 CreateFakeAppName(index), |
| 54 extensions::Extension::TYPE_PLATFORM_APP); |
| 55 } |
| 56 |
| 50 std::string InstallAppForAllProfiles(int index) { | 57 std::string InstallAppForAllProfiles(int index) { |
| 51 for (int i = 0; i < test()->num_clients(); ++i) | 58 for (int i = 0; i < test()->num_clients(); ++i) |
| 52 InstallApp(test()->GetProfile(i), index); | 59 InstallApp(test()->GetProfile(i), index); |
| 53 return InstallApp(test()->verifier(), index); | 60 return InstallApp(test()->verifier(), index); |
| 54 } | 61 } |
| 55 | 62 |
| 56 void UninstallApp(Profile* profile, int index) { | 63 void UninstallApp(Profile* profile, int index) { |
| 57 return SyncExtensionHelper::GetInstance()->UninstallExtension( | 64 return SyncExtensionHelper::GetInstance()->UninstallExtension( |
| 58 profile, CreateFakeAppName(index)); | 65 profile, CreateFakeAppName(index)); |
| 59 } | 66 } |
| (...skipping 12 matching lines...) Expand all Loading... |
| 72 return SyncExtensionHelper::GetInstance()->IncognitoEnableExtension( | 79 return SyncExtensionHelper::GetInstance()->IncognitoEnableExtension( |
| 73 profile, CreateFakeAppName(index)); | 80 profile, CreateFakeAppName(index)); |
| 74 } | 81 } |
| 75 | 82 |
| 76 void IncognitoDisableApp(Profile* profile, int index) { | 83 void IncognitoDisableApp(Profile* profile, int index) { |
| 77 return SyncExtensionHelper::GetInstance()->IncognitoDisableExtension( | 84 return SyncExtensionHelper::GetInstance()->IncognitoDisableExtension( |
| 78 profile, CreateFakeAppName(index)); | 85 profile, CreateFakeAppName(index)); |
| 79 } | 86 } |
| 80 | 87 |
| 81 void InstallAppsPendingForSync(Profile* profile) { | 88 void InstallAppsPendingForSync(Profile* profile) { |
| 82 SyncExtensionHelper::GetInstance()->InstallExtensionsPendingForSync( | 89 SyncExtensionHelper::GetInstance()->InstallExtensionsPendingForSync(profile); |
| 83 profile, extensions::Extension::TYPE_HOSTED_APP); | |
| 84 } | 90 } |
| 85 | 91 |
| 86 syncer::StringOrdinal GetPageOrdinalForApp(Profile* profile, | 92 syncer::StringOrdinal GetPageOrdinalForApp(Profile* profile, |
| 87 int app_index) { | 93 int app_index) { |
| 88 return SyncAppHelper::GetInstance()->GetPageOrdinalForApp( | 94 return SyncAppHelper::GetInstance()->GetPageOrdinalForApp( |
| 89 profile, CreateFakeAppName(app_index)); | 95 profile, CreateFakeAppName(app_index)); |
| 90 } | 96 } |
| 91 | 97 |
| 92 void SetPageOrdinalForApp(Profile* profile, | 98 void SetPageOrdinalForApp(Profile* profile, |
| 93 int app_index, | 99 int app_index, |
| (...skipping 20 matching lines...) Expand all Loading... |
| 114 SetPageOrdinalForApp(destination, index, GetPageOrdinalForApp(source, index)); | 120 SetPageOrdinalForApp(destination, index, GetPageOrdinalForApp(source, index)); |
| 115 SetAppLaunchOrdinalForApp( | 121 SetAppLaunchOrdinalForApp( |
| 116 destination, index, GetAppLaunchOrdinalForApp(source, index)); | 122 destination, index, GetAppLaunchOrdinalForApp(source, index)); |
| 117 } | 123 } |
| 118 | 124 |
| 119 void FixNTPOrdinalCollisions(Profile* profile) { | 125 void FixNTPOrdinalCollisions(Profile* profile) { |
| 120 SyncAppHelper::GetInstance()->FixNTPOrdinalCollisions(profile); | 126 SyncAppHelper::GetInstance()->FixNTPOrdinalCollisions(profile); |
| 121 } | 127 } |
| 122 | 128 |
| 123 } // namespace apps_helper | 129 } // namespace apps_helper |
| OLD | NEW |