| 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" |
| 11 #include "chrome/browser/sync/test/integration/sync_datatype_helper.h" | 11 #include "chrome/browser/sync/test/integration/sync_datatype_helper.h" |
| 12 #include "chrome/browser/sync/test/integration/sync_extension_helper.h" | 12 #include "chrome/browser/sync/test/integration/sync_extension_helper.h" |
| 13 #include "chrome/common/extensions/extension.h" | 13 #include "chrome/common/extensions/manifest.h" |
| 14 | 14 |
| 15 using sync_datatype_helper::test; | 15 using sync_datatype_helper::test; |
| 16 | 16 |
| 17 namespace { | 17 namespace { |
| 18 | 18 |
| 19 std::string CreateFakeAppName(int index) { | 19 std::string CreateFakeAppName(int index) { |
| 20 return "fakeapp" + base::IntToString(index); | 20 return "fakeapp" + base::IntToString(index); |
| 21 } | 21 } |
| 22 | 22 |
| 23 } // namespace | 23 } // namespace |
| (...skipping 13 matching lines...) Expand all Loading... |
| 37 return false; | 37 return false; |
| 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, | 45 profile, |
| 46 CreateFakeAppName(index), | 46 CreateFakeAppName(index), |
| 47 extensions::Extension::TYPE_HOSTED_APP); | 47 extensions::Manifest::TYPE_HOSTED_APP); |
| 48 } | 48 } |
| 49 | 49 |
| 50 std::string InstallPlatformApp(Profile* profile, int index) { | 50 std::string InstallPlatformApp(Profile* profile, int index) { |
| 51 return SyncExtensionHelper::GetInstance()->InstallExtension( | 51 return SyncExtensionHelper::GetInstance()->InstallExtension( |
| 52 profile, | 52 profile, |
| 53 CreateFakeAppName(index), | 53 CreateFakeAppName(index), |
| 54 extensions::Extension::TYPE_PLATFORM_APP); | 54 extensions::Manifest::TYPE_PLATFORM_APP); |
| 55 } | 55 } |
| 56 | 56 |
| 57 std::string InstallAppForAllProfiles(int index) { | 57 std::string InstallAppForAllProfiles(int index) { |
| 58 for (int i = 0; i < test()->num_clients(); ++i) | 58 for (int i = 0; i < test()->num_clients(); ++i) |
| 59 InstallApp(test()->GetProfile(i), index); | 59 InstallApp(test()->GetProfile(i), index); |
| 60 return InstallApp(test()->verifier(), index); | 60 return InstallApp(test()->verifier(), index); |
| 61 } | 61 } |
| 62 | 62 |
| 63 void UninstallApp(Profile* profile, int index) { | 63 void UninstallApp(Profile* profile, int index) { |
| 64 return SyncExtensionHelper::GetInstance()->UninstallExtension( | 64 return SyncExtensionHelper::GetInstance()->UninstallExtension( |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 SetPageOrdinalForApp(destination, index, GetPageOrdinalForApp(source, index)); | 120 SetPageOrdinalForApp(destination, index, GetPageOrdinalForApp(source, index)); |
| 121 SetAppLaunchOrdinalForApp( | 121 SetAppLaunchOrdinalForApp( |
| 122 destination, index, GetAppLaunchOrdinalForApp(source, index)); | 122 destination, index, GetAppLaunchOrdinalForApp(source, index)); |
| 123 } | 123 } |
| 124 | 124 |
| 125 void FixNTPOrdinalCollisions(Profile* profile) { | 125 void FixNTPOrdinalCollisions(Profile* profile) { |
| 126 SyncAppHelper::GetInstance()->FixNTPOrdinalCollisions(profile); | 126 SyncAppHelper::GetInstance()->FixNTPOrdinalCollisions(profile); |
| 127 } | 127 } |
| 128 | 128 |
| 129 } // namespace apps_helper | 129 } // namespace apps_helper |
| OLD | NEW |