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

Unified Diff: sky/engine/core/rendering/RenderBlock.cpp

Issue 681553003: Remove a bunch of unused or never-set settings. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/engine/core/page/FocusController.cpp ('k') | sky/engine/public/web/WebRuntimeFeatures.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/rendering/RenderBlock.cpp
diff --git a/sky/engine/core/rendering/RenderBlock.cpp b/sky/engine/core/rendering/RenderBlock.cpp
index 8d526a5ace6796cf49c3be9e6466b3c7250fa306..f79bd3f255bd9b7c2be4dec7de64608b1b6d680d 100644
--- a/sky/engine/core/rendering/RenderBlock.cpp
+++ b/sky/engine/core/rendering/RenderBlock.cpp
@@ -1413,40 +1413,31 @@ void RenderBlock::paintAsInlineBlock(RenderObject* renderer, PaintInfo& paintInf
}
}
-static inline bool caretBrowsingEnabled(const Frame* frame)
+static inline bool hasCursorCaret(const FrameSelection& selection, const RenderBlock* block)
{
- Settings* settings = frame->settings();
- return settings && settings->caretBrowsingEnabled();
+ return selection.caretRenderer() == block && selection.hasEditableStyle();
}
-static inline bool hasCursorCaret(const FrameSelection& selection, const RenderBlock* block, bool caretBrowsing)
+static inline bool hasDragCaret(const DragCaretController& dragCaretController, const RenderBlock* block)
{
- return selection.caretRenderer() == block && (selection.hasEditableStyle() || caretBrowsing);
-}
-
-static inline bool hasDragCaret(const DragCaretController& dragCaretController, const RenderBlock* block, bool caretBrowsing)
-{
- return dragCaretController.caretRenderer() == block && (dragCaretController.isContentEditable() || caretBrowsing);
+ return dragCaretController.caretRenderer() == block && dragCaretController.isContentEditable();
}
bool RenderBlock::hasCaret() const
{
- bool caretBrowsing = caretBrowsingEnabled(frame());
- return hasCursorCaret(frame()->selection(), this, caretBrowsing)
- || hasDragCaret(frame()->page()->dragCaretController(), this, caretBrowsing);
+ return hasCursorCaret(frame()->selection(), this)
+ || hasDragCaret(frame()->page()->dragCaretController(), this);
}
void RenderBlock::paintCarets(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
{
- bool caretBrowsing = caretBrowsingEnabled(frame());
-
FrameSelection& selection = frame()->selection();
- if (hasCursorCaret(selection, this, caretBrowsing)) {
+ if (hasCursorCaret(selection, this)) {
selection.paintCaret(paintInfo.context, paintOffset, paintInfo.rect);
}
DragCaretController& dragCaretController = frame()->page()->dragCaretController();
- if (hasDragCaret(dragCaretController, this, caretBrowsing)) {
+ if (hasDragCaret(dragCaretController, this)) {
dragCaretController.paintDragCaret(frame(), paintInfo.context, paintOffset, paintInfo.rect);
}
}
« no previous file with comments | « sky/engine/core/page/FocusController.cpp ('k') | sky/engine/public/web/WebRuntimeFeatures.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698