| 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 27 matching lines...) Expand all Loading... |
| 38 } | 38 } |
| 39 } | 39 } |
| 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, CreateFakeAppName(index), Extension::TYPE_HOSTED_APP); | 45 profile, CreateFakeAppName(index), Extension::TYPE_HOSTED_APP); |
| 46 } | 46 } |
| 47 | 47 |
| 48 std::string InstallAppForAllProfiles(int index) { |
| 49 for (int i = 0; i < test()->num_clients(); ++i) |
| 50 InstallApp(test()->GetProfile(i), index); |
| 51 return InstallApp(test()->verifier(), index); |
| 52 } |
| 53 |
| 48 void UninstallApp(Profile* profile, int index) { | 54 void UninstallApp(Profile* profile, int index) { |
| 49 return SyncExtensionHelper::GetInstance()->UninstallExtension( | 55 return SyncExtensionHelper::GetInstance()->UninstallExtension( |
| 50 profile, CreateFakeAppName(index)); | 56 profile, CreateFakeAppName(index)); |
| 51 } | 57 } |
| 52 | 58 |
| 53 void EnableApp(Profile* profile, int index) { | 59 void EnableApp(Profile* profile, int index) { |
| 54 return SyncExtensionHelper::GetInstance()->EnableExtension( | 60 return SyncExtensionHelper::GetInstance()->EnableExtension( |
| 55 profile, CreateFakeAppName(index)); | 61 profile, CreateFakeAppName(index)); |
| 56 } | 62 } |
| 57 | 63 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 SetPageOrdinalForApp(destination, index, GetPageOrdinalForApp(source, index)); | 111 SetPageOrdinalForApp(destination, index, GetPageOrdinalForApp(source, index)); |
| 106 SetAppLaunchOrdinalForApp( | 112 SetAppLaunchOrdinalForApp( |
| 107 destination, index, GetAppLaunchOrdinalForApp(source, index)); | 113 destination, index, GetAppLaunchOrdinalForApp(source, index)); |
| 108 } | 114 } |
| 109 | 115 |
| 110 void FixNTPOrdinalCollisions(Profile* profile) { | 116 void FixNTPOrdinalCollisions(Profile* profile) { |
| 111 SyncAppHelper::GetInstance()->FixNTPOrdinalCollisions(profile); | 117 SyncAppHelper::GetInstance()->FixNTPOrdinalCollisions(profile); |
| 112 } | 118 } |
| 113 | 119 |
| 114 } // namespace apps_helper | 120 } // namespace apps_helper |
| OLD | NEW |