Exemplo n.º 1
0
void FrameCaret::caretBlinkTimerFired(TimerBase*) {
  DCHECK_EQ(m_caretVisibility, CaretVisibility::Visible);
  if (isCaretBlinkingSuspended() && m_shouldPaintCaret)
    return;
  m_shouldPaintCaret = !m_shouldPaintCaret;
  setCaretRectNeedsUpdate();
}
Exemplo n.º 2
0
void FrameCaret::startBlinkCaret() {
  // Start blinking with a black caret. Be sure not to restart if we're
  // already blinking in the right location.
  if (m_caretBlinkTimer.isActive())
    return;

  if (double blinkInterval = LayoutTheme::theme().caretBlinkInterval())
    m_caretBlinkTimer.startRepeating(blinkInterval, BLINK_FROM_HERE);

  m_shouldPaintCaret = true;
  setCaretRectNeedsUpdate();
}
Exemplo n.º 3
0
void DragCaretController::setCaretPosition(const VisiblePosition& position)
{
    m_position = position;
    setCaretRectNeedsUpdate();
    Document* document = 0;
    if (Node* node = m_position.deepEquivalent().deprecatedNode()) {
        document = &node->document();
    }
    if (m_position.isNull() || m_position.isOrphan()) {
        clearCaretRect();
    } else {
        document->updateRenderTreeIfNeeded();
        updateCaretRect(document, m_position);
    }
}
Exemplo n.º 4
0
void FrameCaret::stopCaretBlinkTimer() {
  if (m_caretBlinkTimer.isActive() || m_shouldPaintCaret)
    setCaretRectNeedsUpdate();
  m_shouldPaintCaret = false;
  m_caretBlinkTimer.stop();
}