titled_url_node_sorter.h 921 B

12345678910111213141516171819202122232425262728293031
  1. // Copyright 2016 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.
  4. #ifndef COMPONENTS_BOOKMARKS_BROWSER_TITLED_URL_NODE_SORTER_H_
  5. #define COMPONENTS_BOOKMARKS_BROWSER_TITLED_URL_NODE_SORTER_H_
  6. #include <vector>
  7. #include "base/containers/flat_set.h"
  8. namespace bookmarks {
  9. class TitledUrlNode;
  10. class TitledUrlNodeSorter {
  11. public:
  12. using TitledUrlNodes = std::vector<const TitledUrlNode*>;
  13. using TitledUrlNodeSet = base::flat_set<const TitledUrlNode*>;
  14. virtual ~TitledUrlNodeSorter() {}
  15. // Sorts |matches| in an implementation-specific way, placing the results in
  16. // |sorted_nodes|.
  17. virtual void SortMatches(const TitledUrlNodeSet& matches,
  18. TitledUrlNodes* sorted_nodes) const = 0;
  19. };
  20. } // namespace bookmarks
  21. #endif // COMPONENTS_BOOKMARKS_BROWSER_TITLED_URL_NODE_SORTER_H_