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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_SYNC_TEST_INTEGRATION_SYNC_APP_HELPER_H_
6 #define CHROME_BROWSER_SYNC_TEST_INTEGRATION_SYNC_APP_HELPER_H_
10 #include "base/basictypes.h"
11 #include "base/memory/singleton.h"
12 #include "sync/api/string_ordinal.h"
19 // Singleton implementation.
20 static SyncAppHelper
* GetInstance();
22 // Initializes the profiles in |test| and registers them with
23 // internal data structures.
24 void SetupIfNecessary(SyncTest
* test
);
26 // Returns true iff |profile1| and |profile2| have the same apps and
27 // they are all in the same state.
28 bool AppStatesMatch(Profile
* profile1
, Profile
* profile2
);
30 // Gets the page ordinal value for the applications with |name| in |profile|.
31 syncer::StringOrdinal
GetPageOrdinalForApp(Profile
* profile
,
32 const std::string
& name
);
34 // Sets a new |page_ordinal| value for the application with |name| in
36 void SetPageOrdinalForApp(Profile
* profile
,
37 const std::string
& name
,
38 const syncer::StringOrdinal
& page_ordinal
);
40 // Gets the app launch ordinal value for the application with |name| in
42 syncer::StringOrdinal
GetAppLaunchOrdinalForApp(Profile
* profile
,
43 const std::string
& name
);
45 // Sets a new |app_launch_ordinal| value for the application with |name| in
47 void SetAppLaunchOrdinalForApp(
49 const std::string
& name
,
50 const syncer::StringOrdinal
& app_launch_ordinal
);
52 // Fix any NTP icon collisions that are currently in |profile|.
53 void FixNTPOrdinalCollisions(Profile
* profile
);
56 friend struct DefaultSingletonTraits
<SyncAppHelper
>;
61 bool setup_completed_
;
63 DISALLOW_COPY_AND_ASSIGN(SyncAppHelper
);
66 #endif // CHROME_BROWSER_SYNC_TEST_INTEGRATION_SYNC_APP_HELPER_H_