|
@@ -99,6 +99,12 @@
|
|
|
|
|
|
#if !defined(OS_MACOSX)
|
|
|
#include "ui/aura/window.h"
|
|
|
+#else
|
|
|
+#include "ui/base/cocoa/defaults_utils.h"
|
|
|
+#endif
|
|
|
+
|
|
|
+#if defined(OS_LINUX)
|
|
|
+#include "ui/views/linux_ui/linux_ui.h"
|
|
|
#endif
|
|
|
|
|
|
#if defined(OS_LINUX) || defined(OS_WIN)
|
|
@@ -419,6 +425,25 @@ void WebContents::InitWithSessionAndOptions(
|
|
|
prefs->subpixel_rendering = params->subpixel_rendering;
|
|
|
#endif
|
|
|
|
|
|
+// Honor the system's cursor blink rate settings
|
|
|
+#if defined(OS_MACOSX)
|
|
|
+ base::TimeDelta interval;
|
|
|
+ if (ui::TextInsertionCaretBlinkPeriod(&interval))
|
|
|
+ prefs->caret_blink_interval = interval;
|
|
|
+#elif defined(OS_LINUX)
|
|
|
+ views::LinuxUI* linux_ui = views::LinuxUI::instance();
|
|
|
+ if (linux_ui)
|
|
|
+ prefs->caret_blink_interval = linux_ui->GetCursorBlinkInterval();
|
|
|
+#elif defined(OS_WIN)
|
|
|
+ const auto system_msec = ::GetCaretBlinkTime();
|
|
|
+ if (system_msec != 0) {
|
|
|
+ prefs->caret_blink_interval =
|
|
|
+ (system_msec == INFINITE)
|
|
|
+ ? base::TimeDelta()
|
|
|
+ : base::TimeDelta::FromMilliseconds(system_msec);
|
|
|
+ }
|
|
|
+#endif
|
|
|
+
|
|
|
// Save the preferences in C++.
|
|
|
new WebContentsPreferences(web_contents(), options);
|
|
|
|