1 // Copyright 2014 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 EXTENSIONS_BROWSER_NULL_APP_SORTING_H_
6 #define EXTENSIONS_BROWSER_NULL_APP_SORTING_H_
8 #include "base/compiler_specific.h"
9 #include "base/macros.h"
10 #include "extensions/browser/app_sorting.h"
12 namespace extensions
{
14 // An AppSorting that doesn't provide any ordering.
15 class NullAppSorting
: public AppSorting
{
18 ~NullAppSorting() override
;
20 // AppSorting overrides:
21 void SetExtensionScopedPrefs(ExtensionScopedPrefs
* prefs
) override
;
22 void CheckExtensionScopedPrefs() const override
;
23 void SetExtensionSyncService(
24 ExtensionSyncService
* extension_sync_service
) override
;
25 void Initialize(const ExtensionIdList
& extension_ids
) override
;
26 void FixNTPOrdinalCollisions() override
;
27 void EnsureValidOrdinals(
28 const std::string
& extension_id
,
29 const syncer::StringOrdinal
& suggested_page
) override
;
30 void OnExtensionMoved(const std::string
& moved_extension_id
,
31 const std::string
& predecessor_extension_id
,
32 const std::string
& successor_extension_id
) override
;
33 syncer::StringOrdinal
GetAppLaunchOrdinal(
34 const std::string
& extension_id
) const override
;
35 void SetAppLaunchOrdinal(
36 const std::string
& extension_id
,
37 const syncer::StringOrdinal
& new_app_launch_ordinal
) override
;
38 syncer::StringOrdinal
CreateFirstAppLaunchOrdinal(
39 const syncer::StringOrdinal
& page_ordinal
) const override
;
40 syncer::StringOrdinal
CreateNextAppLaunchOrdinal(
41 const syncer::StringOrdinal
& page_ordinal
) const override
;
42 syncer::StringOrdinal
CreateFirstAppPageOrdinal() const override
;
43 syncer::StringOrdinal
GetNaturalAppPageOrdinal() const override
;
44 syncer::StringOrdinal
GetPageOrdinal(
45 const std::string
& extension_id
) const override
;
46 void SetPageOrdinal(const std::string
& extension_id
,
47 const syncer::StringOrdinal
& new_page_ordinal
) override
;
48 void ClearOrdinals(const std::string
& extension_id
) override
;
49 int PageStringOrdinalAsInteger(
50 const syncer::StringOrdinal
& page_ordinal
) const override
;
51 syncer::StringOrdinal
PageIntegerAsStringOrdinal(size_t page_index
) override
;
52 void SetExtensionVisible(const std::string
& extension_id
,
53 bool visible
) override
;
56 DISALLOW_COPY_AND_ASSIGN(NullAppSorting
);
59 } // namespace extensions
61 #endif // EXTENSIONS_BROWSER_NULL_APP_SORTING_H_