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

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

Issue 2908643002: [DMC #23] Add CompositionMarker (subclass of DocumentMarker) (Closed)
Patch Set: Attempt to fix Android build by using EXPECT_FALSE() Created 3 years, 6 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/Text.h" 34 #include "core/dom/Text.h"
35 #include "core/editing/VisibleUnits.h" 35 #include "core/editing/VisibleUnits.h"
36 #include "core/editing/iterators/TextIterator.h" 36 #include "core/editing/iterators/TextIterator.h"
37 #include "core/editing/markers/CompositionMarker.h"
37 #include "core/editing/markers/CompositionMarkerListImpl.h" 38 #include "core/editing/markers/CompositionMarkerListImpl.h"
38 #include "core/editing/markers/DocumentMarkerListEditor.h" 39 #include "core/editing/markers/DocumentMarkerListEditor.h"
39 #include "core/editing/markers/GrammarMarkerListImpl.h" 40 #include "core/editing/markers/GrammarMarkerListImpl.h"
40 #include "core/editing/markers/SpellingMarkerListImpl.h" 41 #include "core/editing/markers/SpellingMarkerListImpl.h"
41 #include "core/editing/markers/TextMatchMarker.h" 42 #include "core/editing/markers/TextMatchMarker.h"
42 #include "core/editing/markers/TextMatchMarkerListImpl.h" 43 #include "core/editing/markers/TextMatchMarkerListImpl.h"
43 #include "core/frame/LocalFrameView.h" 44 #include "core/frame/LocalFrameView.h"
44 #include "core/layout/LayoutObject.h" 45 #include "core/layout/LayoutObject.h"
45 46
46 #ifndef NDEBUG 47 #ifndef NDEBUG
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 // throttling algorithm. crbug.com/6819. 156 // throttling algorithm. crbug.com/6819.
156 } 157 }
157 158
158 void DocumentMarkerController::AddCompositionMarker(const EphemeralRange& range, 159 void DocumentMarkerController::AddCompositionMarker(const EphemeralRange& range,
159 Color underline_color, 160 Color underline_color,
160 bool thick, 161 bool thick,
161 Color background_color) { 162 Color background_color) {
162 DCHECK(!document_->NeedsLayoutTreeUpdate()); 163 DCHECK(!document_->NeedsLayoutTreeUpdate());
163 AddMarkerInternal(range, [underline_color, thick, background_color]( 164 AddMarkerInternal(range, [underline_color, thick, background_color](
164 int start_offset, int end_offset) { 165 int start_offset, int end_offset) {
165 return new DocumentMarker(start_offset, end_offset, underline_color, thick, 166 return new CompositionMarker(start_offset, end_offset, underline_color,
166 background_color); 167 thick, background_color);
167 }); 168 });
168 } 169 }
169 170
170 void DocumentMarkerController::PrepareForDestruction() { 171 void DocumentMarkerController::PrepareForDestruction() {
171 Clear(); 172 Clear();
172 } 173 }
173 174
174 void DocumentMarkerController::RemoveMarkers( 175 void DocumentMarkerController::RemoveMarkers(
175 TextIterator& marked_text, 176 TextIterator& marked_text,
176 DocumentMarker::MarkerTypes marker_types) { 177 DocumentMarker::MarkerTypes marker_types) {
(...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after
718 } 719 }
719 720
720 } // namespace blink 721 } // namespace blink
721 722
722 #ifndef NDEBUG 723 #ifndef NDEBUG
723 void showDocumentMarkers(const blink::DocumentMarkerController* controller) { 724 void showDocumentMarkers(const blink::DocumentMarkerController* controller) {
724 if (controller) 725 if (controller)
725 controller->ShowMarkers(); 726 controller->ShowMarkers();
726 } 727 }
727 #endif 728 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698