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 24 matching lines...) Expand all Loading... |
35 LOG(ERROR) << "Profile " << i << " doesn't have the same apps as the" | 35 LOG(ERROR) << "Profile " << i << " doesn't have the same apps as the" |
36 " verifier profile."; | 36 " verifier profile."; |
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, CreateFakeAppName(index), Extension::TYPE_HOSTED_APP); | 45 profile, |
| 46 CreateFakeAppName(index), |
| 47 extensions::Extension::TYPE_HOSTED_APP); |
46 } | 48 } |
47 | 49 |
48 std::string InstallAppForAllProfiles(int index) { | 50 std::string InstallAppForAllProfiles(int index) { |
49 for (int i = 0; i < test()->num_clients(); ++i) | 51 for (int i = 0; i < test()->num_clients(); ++i) |
50 InstallApp(test()->GetProfile(i), index); | 52 InstallApp(test()->GetProfile(i), index); |
51 return InstallApp(test()->verifier(), index); | 53 return InstallApp(test()->verifier(), index); |
52 } | 54 } |
53 | 55 |
54 void UninstallApp(Profile* profile, int index) { | 56 void UninstallApp(Profile* profile, int index) { |
55 return SyncExtensionHelper::GetInstance()->UninstallExtension( | 57 return SyncExtensionHelper::GetInstance()->UninstallExtension( |
(...skipping 15 matching lines...) Expand all Loading... |
71 profile, CreateFakeAppName(index)); | 73 profile, CreateFakeAppName(index)); |
72 } | 74 } |
73 | 75 |
74 void IncognitoDisableApp(Profile* profile, int index) { | 76 void IncognitoDisableApp(Profile* profile, int index) { |
75 return SyncExtensionHelper::GetInstance()->IncognitoDisableExtension( | 77 return SyncExtensionHelper::GetInstance()->IncognitoDisableExtension( |
76 profile, CreateFakeAppName(index)); | 78 profile, CreateFakeAppName(index)); |
77 } | 79 } |
78 | 80 |
79 void InstallAppsPendingForSync(Profile* profile) { | 81 void InstallAppsPendingForSync(Profile* profile) { |
80 SyncExtensionHelper::GetInstance()->InstallExtensionsPendingForSync( | 82 SyncExtensionHelper::GetInstance()->InstallExtensionsPendingForSync( |
81 profile, Extension::TYPE_HOSTED_APP); | 83 profile, extensions::Extension::TYPE_HOSTED_APP); |
82 } | 84 } |
83 | 85 |
84 StringOrdinal GetPageOrdinalForApp(Profile* profile, | 86 StringOrdinal GetPageOrdinalForApp(Profile* profile, |
85 int app_index) { | 87 int app_index) { |
86 return SyncAppHelper::GetInstance()->GetPageOrdinalForApp( | 88 return SyncAppHelper::GetInstance()->GetPageOrdinalForApp( |
87 profile, CreateFakeAppName(app_index)); | 89 profile, CreateFakeAppName(app_index)); |
88 } | 90 } |
89 | 91 |
90 void SetPageOrdinalForApp(Profile* profile, | 92 void SetPageOrdinalForApp(Profile* profile, |
91 int app_index, | 93 int app_index, |
(...skipping 19 matching lines...) Expand all Loading... |
111 SetPageOrdinalForApp(destination, index, GetPageOrdinalForApp(source, index)); | 113 SetPageOrdinalForApp(destination, index, GetPageOrdinalForApp(source, index)); |
112 SetAppLaunchOrdinalForApp( | 114 SetAppLaunchOrdinalForApp( |
113 destination, index, GetAppLaunchOrdinalForApp(source, index)); | 115 destination, index, GetAppLaunchOrdinalForApp(source, index)); |
114 } | 116 } |
115 | 117 |
116 void FixNTPOrdinalCollisions(Profile* profile) { | 118 void FixNTPOrdinalCollisions(Profile* profile) { |
117 SyncAppHelper::GetInstance()->FixNTPOrdinalCollisions(profile); | 119 SyncAppHelper::GetInstance()->FixNTPOrdinalCollisions(profile); |
118 } | 120 } |
119 | 121 |
120 } // namespace apps_helper | 122 } // namespace apps_helper |
OLD | NEW |