summaryrefslogtreecommitdiffstats
path: root/widget/windows/TSFTextStore.cpp
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@wolfbeast.com>2020-01-09 13:22:29 +0100
committerwolfbeast <mcwerewolf@wolfbeast.com>2020-01-09 13:22:29 +0100
commitd79cc5fb49131cba4ed1aa86bb13de468a718565 (patch)
treef348d40599d12749d8e4c176dfe83d0a43b1e939 /widget/windows/TSFTextStore.cpp
parent8ae047bbbf0a732744060878339b2f6fdf4ba909 (diff)
downloadUXP-d79cc5fb49131cba4ed1aa86bb13de468a718565.tar
UXP-d79cc5fb49131cba4ed1aa86bb13de468a718565.tar.gz
UXP-d79cc5fb49131cba4ed1aa86bb13de468a718565.tar.lz
UXP-d79cc5fb49131cba4ed1aa86bb13de468a718565.tar.xz
UXP-d79cc5fb49131cba4ed1aa86bb13de468a718565.zip
Issue #1348 - Part 3: Set IS_PRIVATE input scope in private browsing.
Microsoft IME on Windows 10 20H1 (build 19025+) supports IME private mode by input scope. Although previous Windows versions use an undocumented API for Edge and IE only, the next Windows 10 release will use a public API for it. We pre-empt this potential privacy concern by setting the IS_PRIVATE flag when in PB mode.
Diffstat (limited to 'widget/windows/TSFTextStore.cpp')
-rw-r--r--widget/windows/TSFTextStore.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/widget/windows/TSFTextStore.cpp b/widget/windows/TSFTextStore.cpp
index c80de831c..12b8cd0c1 100644
--- a/widget/windows/TSFTextStore.cpp
+++ b/widget/windows/TSFTextStore.cpp
@@ -1355,7 +1355,9 @@ TSFTextStore::Init(nsWindowBase* aWidget,
return false;
}
- SetInputScope(aContext.mHTMLInputType, aContext.mHTMLInputInputmode);
+ SetInputScope(aContext.mHTMLInputType,
+ aContext.mHTMLInputInputmode,
+ aContext.mInPrivateBrowsing);
// Create document manager
RefPtr<ITfThreadMgr> threadMgr = sThreadMgr;
@@ -3205,9 +3207,15 @@ TSFTextStore::InsertEmbedded(DWORD dwFlags,
void
TSFTextStore::SetInputScope(const nsString& aHTMLInputType,
- const nsString& aHTMLInputInputMode)
+ const nsString& aHTMLInputInputMode,
+ bool aInPrivateBrowsing)
{
mInputScopes.Clear();
+
+ if (aInPrivateBrowsing) {
+ mInputScopes.AppendElement(IS_PRIVATE);
+ }
+
if (aHTMLInputType.IsEmpty() || aHTMLInputType.EqualsLiteral("text")) {
if (aHTMLInputInputMode.EqualsLiteral("url")) {
mInputScopes.AppendElement(IS_URL);
@@ -5688,7 +5696,8 @@ TSFTextStore::SetInputContext(nsWindowBase* aWidget,
if (sEnabledTextStore) {
RefPtr<TSFTextStore> textStore(sEnabledTextStore);
textStore->SetInputScope(aContext.mHTMLInputType,
- aContext.mHTMLInputInputmode);
+ aContext.mHTMLInputInputmode,
+ aContext.mInPrivateBrowsing);
}
return;
}