Re-subimission of https://codereview.chromium.org/1041213003/
[chromium-blink-merge.git] / extensions / browser / null_app_sorting.cc
blob384f5b14a60c353e1bda3ecf42e0cdfe43f3071d
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 #include "extensions/browser/null_app_sorting.h"
7 #include "sync/api/string_ordinal.h"
9 namespace {
11 // Ordinals for a single app on a single page.
12 const char kFirstApp[] = "a";
13 const char kNextApp[] = "b";
14 const char kFirstPage[] = "a";
16 } // namespace
18 namespace extensions {
20 NullAppSorting::NullAppSorting() {
23 NullAppSorting::~NullAppSorting() {
26 void NullAppSorting::SetExtensionScopedPrefs(ExtensionScopedPrefs* prefs) {
29 void NullAppSorting::SetExtensionSyncService(
30 ExtensionSyncService* extension_sync_service) {
33 void NullAppSorting::Initialize(const ExtensionIdList& extension_ids) {
36 void NullAppSorting::FixNTPOrdinalCollisions() {
39 void NullAppSorting::EnsureValidOrdinals(
40 const std::string& extension_id,
41 const syncer::StringOrdinal& suggested_page) {
44 void NullAppSorting::OnExtensionMoved(
45 const std::string& moved_extension_id,
46 const std::string& predecessor_extension_id,
47 const std::string& successor_extension_id) {
50 syncer::StringOrdinal NullAppSorting::GetAppLaunchOrdinal(
51 const std::string& extension_id) const {
52 return syncer::StringOrdinal(kFirstApp);
55 void NullAppSorting::SetAppLaunchOrdinal(
56 const std::string& extension_id,
57 const syncer::StringOrdinal& new_app_launch_ordinal) {
60 syncer::StringOrdinal NullAppSorting::CreateFirstAppLaunchOrdinal(
61 const syncer::StringOrdinal& page_ordinal) const {
62 return syncer::StringOrdinal(kFirstApp);
65 syncer::StringOrdinal NullAppSorting::CreateNextAppLaunchOrdinal(
66 const syncer::StringOrdinal& page_ordinal) const {
67 return syncer::StringOrdinal(kNextApp);
70 syncer::StringOrdinal NullAppSorting::CreateFirstAppPageOrdinal() const {
71 return syncer::StringOrdinal(kFirstPage);
74 syncer::StringOrdinal NullAppSorting::GetNaturalAppPageOrdinal() const {
75 return syncer::StringOrdinal(kFirstPage);
78 syncer::StringOrdinal NullAppSorting::GetPageOrdinal(
79 const std::string& extension_id) const {
80 return syncer::StringOrdinal(kFirstPage);
83 void NullAppSorting::SetPageOrdinal(
84 const std::string& extension_id,
85 const syncer::StringOrdinal& new_page_ordinal) {
88 void NullAppSorting::ClearOrdinals(const std::string& extension_id) {
91 int NullAppSorting::PageStringOrdinalAsInteger(
92 const syncer::StringOrdinal& page_ordinal) const {
93 return 0;
96 syncer::StringOrdinal NullAppSorting::PageIntegerAsStringOrdinal(
97 size_t page_index) {
98 return syncer::StringOrdinal(kFirstPage);
101 void NullAppSorting::SetExtensionVisible(const std::string& extension_id,
102 bool visible) {
105 } // namespace extensions