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/shell/browser/shell_app_sorting.h"
7 #include "sync/api/string_ordinal.h"
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";
18 namespace extensions {
20 ShellAppSorting::ShellAppSorting() {
23 ShellAppSorting::~ShellAppSorting() {
26 void ShellAppSorting::SetExtensionScopedPrefs(ExtensionScopedPrefs* prefs) {
29 void ShellAppSorting::SetExtensionSyncService(
30 ExtensionSyncService* extension_sync_service) {
33 void ShellAppSorting::Initialize(const ExtensionIdList& extension_ids) {
36 void ShellAppSorting::FixNTPOrdinalCollisions() {
39 void ShellAppSorting::EnsureValidOrdinals(
40 const std::string& extension_id,
41 const syncer::StringOrdinal& suggested_page) {
44 void ShellAppSorting::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 ShellAppSorting::GetAppLaunchOrdinal(
51 const std::string& extension_id) const {
52 return syncer::StringOrdinal(kFirstApp);
55 void ShellAppSorting::SetAppLaunchOrdinal(
56 const std::string& extension_id,
57 const syncer::StringOrdinal& new_app_launch_ordinal) {
60 syncer::StringOrdinal ShellAppSorting::CreateFirstAppLaunchOrdinal(
61 const syncer::StringOrdinal& page_ordinal) const {
62 return syncer::StringOrdinal(kFirstApp);
65 syncer::StringOrdinal ShellAppSorting::CreateNextAppLaunchOrdinal(
66 const syncer::StringOrdinal& page_ordinal) const {
67 return syncer::StringOrdinal(kNextApp);
70 syncer::StringOrdinal ShellAppSorting::CreateFirstAppPageOrdinal() const {
71 return syncer::StringOrdinal(kFirstPage);
74 syncer::StringOrdinal ShellAppSorting::GetNaturalAppPageOrdinal() const {
75 return syncer::StringOrdinal(kFirstPage);
78 syncer::StringOrdinal ShellAppSorting::GetPageOrdinal(
79 const std::string& extension_id) const {
80 return syncer::StringOrdinal(kFirstPage);
83 void ShellAppSorting::SetPageOrdinal(
84 const std::string& extension_id,
85 const syncer::StringOrdinal& new_page_ordinal) {
88 void ShellAppSorting::ClearOrdinals(const std::string& extension_id) {
91 int ShellAppSorting::PageStringOrdinalAsInteger(
92 const syncer::StringOrdinal& page_ordinal) const {
96 syncer::StringOrdinal ShellAppSorting::PageIntegerAsStringOrdinal(
98 return syncer::StringOrdinal(kFirstPage);
101 void ShellAppSorting::SetExtensionVisible(const std::string& extension_id,
105 } // namespace extensions