Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(187)

Side by Side Diff: components/enhanced_bookmarks/stars_position.h

Issue 510543002: Introduce ItemPosition class for enhanced bookmarks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
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.
4
5 #ifndef COMPONENTS_ENHANCED_BOOKMARKS_STARS_POSITION_H_
6 #define COMPONENTS_ENHANCED_BOOKMARKS_STARS_POSITION_H_
7
8 #include <string>
9 #include <vector>
10
11 namespace enhanced_bookmarks {
12
13 class StarsPosition {
Mark 2014/09/04 21:51:24 Please add class level comment as to what this is
Rune Fevang 2014/09/04 22:56:47 Done.
14 public:
15 ~StarsPosition();
16
17 static StarsPosition CreateInitialPosition();
18
19 static StarsPosition CreateBefore(const StarsPosition& other);
20 static StarsPosition CreateBetween(const StarsPosition& before,
21 const StarsPosition& after);
22 static StarsPosition CreateAfter(const StarsPosition& other);
23
24 bool IsValid() const;
25
26 std::string ToString() const;
27
28 private:
29 typedef std::vector<char> PositionVector;
30
31 StarsPosition();
32 explicit StarsPosition(const PositionVector& position);
33
34 static PositionVector CreateBeforeImpl(const PositionVector& before,
35 size_t from_index);
36 static PositionVector CreateBetweenImpl(const PositionVector& before,
37 const PositionVector& after);
38 static PositionVector CreateAfterImpl(const PositionVector& after,
39 size_t from_index);
40
41 PositionVector position_;
42 };
43
44 } // namespace enhanced_bookmarks
45
46 #endif // COMPONENTS_ENHANCED_BOOKMARKS_STARS_POSITION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698