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

Side by Side Diff: third_party/WebKit/Source/core/editing/markers/CompositionMarkerList.cpp

Issue 2805553003: DocumentMarkerList refactor as an interface (Closed)
Patch Set: Rebase on renaming patch, respond to comments Created 3 years, 8 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 2017 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 #include "core/editing/markers/CompositionMarkerList.h"
6
7 #include "core/editing/markers/DocumentMarkerListEditor.h"
8
9 namespace blink {
10
11 CompositionMarkerList::CompositionMarkerList() : DocumentMarkerList() {}
12
13 DocumentMarker::MarkerType CompositionMarkerList::GetAllowedMarkerType() const {
14 return DocumentMarker::kComposition;
15 }
16
17 bool CompositionMarkerList::Empty() const {
18 return markers_.IsEmpty();
19 }
20
21 DocumentMarker* CompositionMarkerList::At(size_t index) {
22 return markers_[index].Get();
23 }
24
25 void CompositionMarkerList::Add(DocumentMarker* marker) {
26 markers_.push_back(marker);
27 }
28
29 void CompositionMarkerList::Clear() {
30 markers_.Clear();
31 }
32
33 void CompositionMarkerList::AppendMarkersToInputList(
34 DocumentMarkerVector* list) const {
35 list->AppendVector(markers_);
36 }
37
38 DocumentMarkerList::DidMoveMarkerOrNot CompositionMarkerList::MoveMarkers(
39 int length,
40 DocumentMarkerList* dst_list) {
41 return DocumentMarkerListEditor::MoveUnsortedMarkers(&markers_, length,
42 dst_list);
43 }
44
45 DocumentMarkerList::DidRemoveMarkerOrNot CompositionMarkerList::RemoveMarkers(
46 unsigned start_offset,
47 int length) {
48 return DocumentMarkerListEditor::RemoveUnsortedMarkers(&markers_,
49 start_offset, length);
50 }
51
52 DocumentMarkerList::DidShiftMarkerOrNot CompositionMarkerList::ShiftMarkers(
53 unsigned offset,
54 unsigned old_length,
55 unsigned new_length) {
56 return DocumentMarkerListEditor::ShiftUnsortedMarkers(&markers_, offset,
57 old_length, new_length);
58 }
59
60 DEFINE_TRACE(CompositionMarkerList) {
61 visitor->Trace(markers_);
62 DocumentMarkerList::Trace(visitor);
63 }
64
65 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698