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

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

Issue 2820343004: [DMC #4] Add CompositionMarkerListImpl (Closed)
Patch Set: Fix nits Created 3 years, 7 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
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights
7 * reserved. 7 * reserved.
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved.
9 * (http://www.torchmobile.com/) 9 * (http://www.torchmobile.com/)
10 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
(...skipping 16 matching lines...) Expand all
27 */ 27 */
28 28
29 #include "core/editing/markers/DocumentMarkerController.h" 29 #include "core/editing/markers/DocumentMarkerController.h"
30 30
31 #include <algorithm> 31 #include <algorithm>
32 #include "core/dom/Node.h" 32 #include "core/dom/Node.h"
33 #include "core/dom/NodeTraversal.h" 33 #include "core/dom/NodeTraversal.h"
34 #include "core/dom/Range.h" 34 #include "core/dom/Range.h"
35 #include "core/dom/Text.h" 35 #include "core/dom/Text.h"
36 #include "core/editing/iterators/TextIterator.h" 36 #include "core/editing/iterators/TextIterator.h"
37 #include "core/editing/markers/CompositionMarkerListImpl.h"
37 #include "core/editing/markers/DocumentMarkerListEditor.h" 38 #include "core/editing/markers/DocumentMarkerListEditor.h"
38 #include "core/editing/markers/GenericDocumentMarkerListImpl.h" 39 #include "core/editing/markers/GenericDocumentMarkerListImpl.h"
39 #include "core/editing/markers/RenderedDocumentMarker.h" 40 #include "core/editing/markers/RenderedDocumentMarker.h"
40 #include "core/frame/FrameView.h" 41 #include "core/frame/FrameView.h"
41 #include "core/layout/LayoutObject.h" 42 #include "core/layout/LayoutObject.h"
42 43
43 #ifndef NDEBUG 44 #ifndef NDEBUG
44 #include <stdio.h> 45 #include <stdio.h>
45 #endif 46 #endif
46 47
(...skipping 12 matching lines...) Expand all
59 return DocumentMarker::kTextMatchMarkerIndex; 60 return DocumentMarker::kTextMatchMarkerIndex;
60 case DocumentMarker::kComposition: 61 case DocumentMarker::kComposition:
61 return DocumentMarker::kCompositionMarkerIndex; 62 return DocumentMarker::kCompositionMarkerIndex;
62 } 63 }
63 64
64 NOTREACHED(); 65 NOTREACHED();
65 return DocumentMarker::kSpellingMarkerIndex; 66 return DocumentMarker::kSpellingMarkerIndex;
66 } 67 }
67 68
68 DocumentMarkerList* CreateListForType(DocumentMarker::MarkerType type) { 69 DocumentMarkerList* CreateListForType(DocumentMarker::MarkerType type) {
69 // All MarkerTypes use GenericDocumentMarkerListImpl for now. Eventually we 70 switch (type) {
70 // will use different marker list classes for different MarkerTypes. 71 case DocumentMarker::kComposition:
71 return new GenericDocumentMarkerListImpl(); 72 return new CompositionMarkerListImpl();
73 default:
74 return new GenericDocumentMarkerListImpl();
75 }
72 } 76 }
73 77
74 } // namespace 78 } // namespace
75 79
76 Member<DocumentMarkerList>& DocumentMarkerController::ListForType( 80 Member<DocumentMarkerList>& DocumentMarkerController::ListForType(
77 MarkerLists* marker_lists, 81 MarkerLists* marker_lists,
78 DocumentMarker::MarkerType type) { 82 DocumentMarker::MarkerType type) {
79 const size_t marker_list_index = MarkerTypeToMarkerIndex(type); 83 const size_t marker_list_index = MarkerTypeToMarkerIndex(type);
80 return (*marker_lists)[marker_list_index]; 84 return (*marker_lists)[marker_list_index];
81 } 85 }
(...skipping 659 matching lines...) Expand 10 before | Expand all | Expand 10 after
741 } 745 }
742 746
743 } // namespace blink 747 } // namespace blink
744 748
745 #ifndef NDEBUG 749 #ifndef NDEBUG
746 void showDocumentMarkers(const blink::DocumentMarkerController* controller) { 750 void showDocumentMarkers(const blink::DocumentMarkerController* controller) {
747 if (controller) 751 if (controller)
748 controller->ShowMarkers(); 752 controller->ShowMarkers();
749 } 753 }
750 #endif 754 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698