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

Side by Side Diff: Source/core/editing/Caret.cpp

Issue 299353004: Oilpan: move editing objects to the heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Make test wrapper class finalized Created 6 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
« no previous file with comments | « Source/core/editing/Caret.h ('k') | Source/core/editing/CompositeEditCommand.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2008, 2009, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2008, 2009, 2010 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 28 matching lines...) Expand all
39 : m_caretRectNeedsUpdate(true) 39 : m_caretRectNeedsUpdate(true)
40 , m_caretVisibility(visibility) 40 , m_caretVisibility(visibility)
41 { 41 {
42 } 42 }
43 43
44 DragCaretController::DragCaretController() 44 DragCaretController::DragCaretController()
45 : CaretBase(Visible) 45 : CaretBase(Visible)
46 { 46 {
47 } 47 }
48 48
49 PassOwnPtr<DragCaretController> DragCaretController::create() 49 PassOwnPtrWillBeRawPtr<DragCaretController> DragCaretController::create()
50 { 50 {
51 return adoptPtr(new DragCaretController); 51 return adoptPtrWillBeNoop(new DragCaretController);
52 } 52 }
53 53
54 bool DragCaretController::isContentRichlyEditable() const 54 bool DragCaretController::isContentRichlyEditable() const
55 { 55 {
56 return isRichlyEditablePosition(m_position.deepEquivalent()); 56 return isRichlyEditablePosition(m_position.deepEquivalent());
57 } 57 }
58 58
59 void DragCaretController::setCaretPosition(const VisiblePosition& position) 59 void DragCaretController::setCaretPosition(const VisiblePosition& position)
60 { 60 {
61 if (Node* node = m_position.deepEquivalent().deprecatedNode()) 61 if (Node* node = m_position.deepEquivalent().deprecatedNode())
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 if (!hasCaret() || !node.inActiveDocument()) 93 if (!hasCaret() || !node.inActiveDocument())
94 return; 94 return;
95 95
96 if (!removingNodeRemovesPosition(node, m_position.deepEquivalent())) 96 if (!removingNodeRemovesPosition(node, m_position.deepEquivalent()))
97 return; 97 return;
98 98
99 m_position.deepEquivalent().document()->renderView()->clearSelection(); 99 m_position.deepEquivalent().document()->renderView()->clearSelection();
100 clear(); 100 clear();
101 } 101 }
102 102
103 void DragCaretController::trace(Visitor* visitor)
104 {
105 visitor->trace(m_position);
106 }
107
103 void CaretBase::clearCaretRect() 108 void CaretBase::clearCaretRect()
104 { 109 {
105 m_caretLocalRect = LayoutRect(); 110 m_caretLocalRect = LayoutRect();
106 } 111 }
107 112
108 static inline bool caretRendersInsideNode(Node* node) 113 static inline bool caretRendersInsideNode(Node* node)
109 { 114 {
110 return node && !isRenderedTable(node) && !editingIgnoresContent(node); 115 return node && !isRenderedTable(node) && !editingIgnoresContent(node);
111 } 116 }
112 117
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 context->fillRect(caret, caretColor); 261 context->fillRect(caret, caretColor);
257 } 262 }
258 263
259 void DragCaretController::paintDragCaret(LocalFrame* frame, GraphicsContext* p, const LayoutPoint& paintOffset, const LayoutRect& clipRect) const 264 void DragCaretController::paintDragCaret(LocalFrame* frame, GraphicsContext* p, const LayoutPoint& paintOffset, const LayoutRect& clipRect) const
260 { 265 {
261 if (m_position.deepEquivalent().deprecatedNode()->document().frame() == fram e) 266 if (m_position.deepEquivalent().deprecatedNode()->document().frame() == fram e)
262 paintCaret(m_position.deepEquivalent().deprecatedNode(), p, paintOffset, clipRect); 267 paintCaret(m_position.deepEquivalent().deprecatedNode(), p, paintOffset, clipRect);
263 } 268 }
264 269
265 } 270 }
OLDNEW
« no previous file with comments | « Source/core/editing/Caret.h ('k') | Source/core/editing/CompositeEditCommand.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698