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

Unified Diff: src/webkit/port/rendering/RenderThemeWin.cpp

Issue 12644: Query the system for the blink interval setting. (Closed)
Patch Set: Merge Created 12 years, 1 month 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/webkit/port/rendering/RenderThemeWin.cpp
diff --git a/src/webkit/port/rendering/RenderThemeWin.cpp b/src/webkit/port/rendering/RenderThemeWin.cpp
index a740c9e247ab705a50a707a3de89d25a84b88c27..f7b47f0ae471838b933c0e5b533140bf4d2b403a 100644
--- a/src/webkit/port/rendering/RenderThemeWin.cpp
+++ b/src/webkit/port/rendering/RenderThemeWin.cpp
@@ -182,6 +182,15 @@ static void setSizeIfAuto(RenderStyle* style, const IntSize& size)
style->setHeight(Length(size.height(), Fixed));
}
+static double querySystemBlinkInterval(double defaultInterval) {
+ UINT blinkTime = ::GetCaretBlinkTime();
+ if (blinkTime == 0)
+ return defaultInterval;
+ if (blinkTime == INFINITE)
+ return 0;
+ return blinkTime / 1000.0;
+}
+
// Implement WebCore::theme() for getting the global RenderTheme.
RenderTheme* theme()
{
@@ -243,8 +252,9 @@ double RenderThemeWin::caretBlinkFrequency() const
if (ChromiumBridge::layoutTestMode())
return 0;
- // TODO(ericroman): this should be using the platform's blink frequency.
- return RenderTheme::caretBlinkFrequency();
+ // This involves a system call, so we cache the result.
+ static double blinkInterval = querySystemBlinkInterval(RenderTheme::caretBlinkFrequency());
+ return blinkInterval;
}
void RenderThemeWin::systemFont(int propId, Document* document, FontDescription& fontDescription) const
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698