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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « Source/core/workers/WorkerNavigator.h ('k') | Source/core/workers/WorkerNavigator.idl » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 return m_userAgent; 44 return m_userAgent;
45 } 45 }
46 46
47 void WorkerNavigator::trace(Visitor* visitor) 47 void WorkerNavigator::trace(Visitor* visitor)
48 { 48 {
49 #if ENABLE(OILPAN) 49 #if ENABLE(OILPAN)
50 HeapSupplementable<WorkerNavigator>::trace(visitor); 50 HeapSupplementable<WorkerNavigator>::trace(visitor);
51 #endif 51 #endif
52 } 52 }
53 53
54 void WorkerNavigator::setUserPreferredLanguagesForWorkers(const Vector<String>& languages)
55 {
56 m_userPreferredLanguages = languages;
57 }
58
59 AtomicString WorkerNavigator::language()
60 {
61 if (!m_userPreferredLanguages.isEmpty())
62 return AtomicString(m_userPreferredLanguages.at(0));
63
64 return emptyAtom;
65 }
66
67 Vector<String> WorkerNavigator::languages()
68 {
69 return m_userPreferredLanguages;
70 }
71
54 } // namespace blink 72 } // namespace blink
OLDNEW
« 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