Roll src/third_party/WebKit d9c6159:8139f33 (svn 201974:201975)
[chromium-blink-merge.git] / extensions / browser / null_app_sorting.cc
blob6161d5d81dcb1ee110164c8d5970c8da94a75051
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::FixNTPOrdinalCollisions() {
29 void NullAppSorting::EnsureValidOrdinals(
30 const std::string& extension_id,
31 const syncer::StringOrdinal& suggested_page) {
34 void NullAppSorting::OnExtensionMoved(
35 const std::string& moved_extension_id,
36 const std::string& predecessor_extension_id,
37 const std::string& successor_extension_id) {
40 syncer::StringOrdinal NullAppSorting::GetAppLaunchOrdinal(
41 const std::string& extension_id) const {
42 return syncer::StringOrdinal(kFirstApp);
45 void NullAppSorting::SetAppLaunchOrdinal(
46 const std::string& extension_id,
47 const syncer::StringOrdinal& new_app_launch_ordinal) {
50 syncer::StringOrdinal NullAppSorting::CreateFirstAppLaunchOrdinal(
51 const syncer::StringOrdinal& page_ordinal) const {
52 return syncer::StringOrdinal(kFirstApp);
55 syncer::StringOrdinal NullAppSorting::CreateNextAppLaunchOrdinal(
56 const syncer::StringOrdinal& page_ordinal) const {
57 return syncer::StringOrdinal(kNextApp);
60 syncer::StringOrdinal NullAppSorting::CreateFirstAppPageOrdinal() const {
61 return syncer::StringOrdinal(kFirstPage);
64 syncer::StringOrdinal NullAppSorting::GetNaturalAppPageOrdinal() const {
65 return syncer::StringOrdinal(kFirstPage);
68 syncer::StringOrdinal NullAppSorting::GetPageOrdinal(
69 const std::string& extension_id) const {
70 return syncer::StringOrdinal(kFirstPage);
73 void NullAppSorting::SetPageOrdinal(
74 const std::string& extension_id,
75 const syncer::StringOrdinal& new_page_ordinal) {
78 void NullAppSorting::ClearOrdinals(const std::string& extension_id) {
81 int NullAppSorting::PageStringOrdinalAsInteger(
82 const syncer::StringOrdinal& page_ordinal) const {
83 return 0;
86 syncer::StringOrdinal NullAppSorting::PageIntegerAsStringOrdinal(
87 size_t page_index) {
88 return syncer::StringOrdinal(kFirstPage);
91 void NullAppSorting::SetExtensionVisible(const std::string& extension_id,
92 bool visible) {
95 } // namespace extensions