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

Unified Diff: Source/core/workers/WorkerNavigator.cpp

Issue 592183002: [WIP]Implement Blink side changes for navigator.language(s) support for workers. Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Dedicated worker languagechange event added. Still WIP. 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 | « Source/core/workers/WorkerNavigator.h ('k') | Source/core/workers/WorkerNavigator.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/workers/WorkerNavigator.cpp
diff --git a/Source/core/workers/WorkerNavigator.cpp b/Source/core/workers/WorkerNavigator.cpp
index 148a9cd50171fab9be34a33fc0255a6185698ab6..97bcb193a8c986b74b33841bebacfa1f99b96110 100644
--- a/Source/core/workers/WorkerNavigator.cpp
+++ b/Source/core/workers/WorkerNavigator.cpp
@@ -51,4 +51,22 @@ void WorkerNavigator::trace(Visitor* visitor)
#endif
}
+void WorkerNavigator::setUserPreferredLanguagesForWorkers(const Vector<String>& languages)
+{
+ m_userPreferredLanguages = languages;
+}
+
+AtomicString WorkerNavigator::language()
+{
+ if (!m_userPreferredLanguages.isEmpty())
+ return AtomicString(m_userPreferredLanguages.at(0));
+
+ return emptyAtom;
+}
+
+Vector<String> WorkerNavigator::languages()
+{
+ return m_userPreferredLanguages;
+}
+
} // namespace blink
« no previous file with comments | « Source/core/workers/WorkerNavigator.h ('k') | Source/core/workers/WorkerNavigator.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698