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 2868413002: [DMC #5.55] Add DocumentMarkerList::MarkerType() (Closed)
Patch Set: Fix mistake in comment 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 19 matching lines...) Expand all
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/CompositionMarkerListImpl.h"
38 #include "core/editing/markers/DocumentMarkerListEditor.h" 38 #include "core/editing/markers/DocumentMarkerListEditor.h"
39 #include "core/editing/markers/GenericDocumentMarkerListImpl.h" 39 #include "core/editing/markers/GenericDocumentMarkerListImpl.h"
40 #include "core/editing/markers/GrammarMarkerListImpl.h"
40 #include "core/editing/markers/RenderedDocumentMarker.h" 41 #include "core/editing/markers/RenderedDocumentMarker.h"
41 #include "core/editing/markers/SpellCheckMarkerListImpl.h" 42 #include "core/editing/markers/SpellingMarkerListImpl.h"
42 #include "core/frame/FrameView.h" 43 #include "core/frame/FrameView.h"
43 #include "core/layout/LayoutObject.h" 44 #include "core/layout/LayoutObject.h"
44 45
45 #ifndef NDEBUG 46 #ifndef NDEBUG
46 #include <stdio.h> 47 #include <stdio.h>
47 #endif 48 #endif
48 49
49 namespace blink { 50 namespace blink {
50 51
51 namespace { 52 namespace {
(...skipping 13 matching lines...) Expand all
65 66
66 NOTREACHED(); 67 NOTREACHED();
67 return DocumentMarker::kSpellingMarkerIndex; 68 return DocumentMarker::kSpellingMarkerIndex;
68 } 69 }
69 70
70 DocumentMarkerList* CreateListForType(DocumentMarker::MarkerType type) { 71 DocumentMarkerList* CreateListForType(DocumentMarker::MarkerType type) {
71 switch (type) { 72 switch (type) {
72 case DocumentMarker::kComposition: 73 case DocumentMarker::kComposition:
73 return new CompositionMarkerListImpl(); 74 return new CompositionMarkerListImpl();
74 case DocumentMarker::kSpelling: 75 case DocumentMarker::kSpelling:
76 return new SpellingMarkerListImpl();
75 case DocumentMarker::kGrammar: 77 case DocumentMarker::kGrammar:
76 return new SpellCheckMarkerListImpl(); 78 return new GrammarMarkerListImpl();
77 default: 79 default:
78 return new GenericDocumentMarkerListImpl(); 80 return new GenericDocumentMarkerListImpl(type);
79 } 81 }
80 } 82 }
81 83
82 } // namespace 84 } // namespace
83 85
84 Member<DocumentMarkerList>& DocumentMarkerController::ListForType( 86 Member<DocumentMarkerList>& DocumentMarkerController::ListForType(
85 MarkerLists* marker_lists, 87 MarkerLists* marker_lists,
86 DocumentMarker::MarkerType type) { 88 DocumentMarker::MarkerType type) {
87 const size_t marker_list_index = MarkerTypeToMarkerIndex(type); 89 const size_t marker_list_index = MarkerTypeToMarkerIndex(type);
88 return (*marker_lists)[marker_list_index]; 90 return (*marker_lists)[marker_list_index];
(...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after
735 } 737 }
736 738
737 } // namespace blink 739 } // namespace blink
738 740
739 #ifndef NDEBUG 741 #ifndef NDEBUG
740 void showDocumentMarkers(const blink::DocumentMarkerController* controller) { 742 void showDocumentMarkers(const blink::DocumentMarkerController* controller) {
741 if (controller) 743 if (controller)
742 controller->ShowMarkers(); 744 controller->ShowMarkers();
743 } 745 }
744 #endif 746 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698