Closed
Bug 1102297
Opened 11 years ago
Closed 11 years ago
Investigate whether we can get country data from Windows APIs
Categories
(Core :: Widget: Win32, defect)
Tracking
()
RESOLVED
FIXED
mozilla38
People
(Reporter: benjamin, Assigned: bugzilla)
References
Details
Attachments
(1 file, 1 obsolete file)
|
6.76 KB,
patch
|
bugzilla
:
review+
Sylvestre
:
approval-mozilla-aurora+
Sylvestre
:
approval-mozilla-beta-
|
Details | Diff | Splinter Review |
+++ This bug was initially created as a clone of Bug #1102295 +++
In order to target the new Yahoo! search default, we'd like to be able to change the default of users within the US but not some other countries (particularly asian countries).
Our base plan is to do this by time zone, but we'd like to investigate targeting this a little more carefully by country based on information already contained in the OS. Jim, can you provide an overview what other information we can obtain from Windows about the user's country, and the APIs?
This is extremely urgent, if you can't provide info by today please let me know.
Flags: needinfo?(jmathies)
Comment 1•11 years ago
|
||
Getting actual regional location probably isn't possible without hitting the network, but win32 does have the concept of a language locale, which includes information about language regions. (for example en-US, en-ZA, ..).
Would this suffice?
here's nice page on apis available:
https://www.globalyzer.com/gzserver/help/reference/localeSensitiveMethods/winlocalefunc.html
Flags: needinfo?(jmathies)
| Reporter | ||
Comment 2•11 years ago
|
||
I suspect that data will not be good enough for the use case.
Is there anything that will let us distinguish between nothern-hemisphere and southern-hemisphere (by time zone setting, for example)?
Flags: needinfo?(jmathies)
Comment 3•11 years ago
|
||
(In reply to Benjamin Smedberg [:bsmedberg] from comment #2)
> I suspect that data will not be good enough for the use case.
> Is there anything that will let us distinguish between nothern-hemisphere
> and southern-hemisphere (by time zone setting, for example)?
Time zones might work although it looks like we'll be dealing with strings vs. an identifier, which could be problematic since the strings are also localized.
GetTimeZoneInformation:
http://msdn.microsoft.com/en-us/library/windows/desktop/ms724421%28v=vs.85%29.aspx
http://msdn.microsoft.com/en-us/library/windows/desktop/ms725481%28v=vs.85%29.aspx
I also found GetUserGeoID which works on XP and up -
api: http://msdn.microsoft.com/en-us/library/dd318138.aspx
ids: http://msdn.microsoft.com/en-us/library/dd374073.aspx
I've never worked with this api so I'm not sure how reliable it is. We could add a telemetry probe to pick this up, see what we get..
Flags: needinfo?(jmathies)
| Reporter | ||
Comment 4•11 years ago
|
||
don't think we can trust this data enough to do anything for 34. I'm going to leave this open for the future, but it's not an immediate priority. Thanks for the research.
Updated•11 years ago
|
status-firefox34:
--- → affected
status-firefox35:
--- → affected
status-firefox36:
--- → affected
tracking-firefox34:
--- → +
tracking-firefox35:
--- → +
tracking-firefox36:
--- → +
Updated•11 years ago
|
Comment 5•11 years ago
|
||
GetUserGeoID() will take the value from the [Location] tab of the [Region] control panel applet.
http://www.integration.co.nz/images/win7-locale.png
Comment 6•11 years ago
|
||
Or [PC Settings]-[Time and language]-[Region and language]-[Country or region].
http://www.7tutorials.com/files/img/win8_keyb_input/keyboard_language20.png
Comment 7•11 years ago
|
||
GetUserGeoID sounds like what we want. Looks to be supported on XP and later. We can combine that with a call to GetGeoInfo (with GeoType=GEO_ISO2) to map the GEOID to a 2-letter country code.
Benjamin, can someone on your team take this and get it uplifted to 36? I'd like to get this and bug 1102295 used instead of the timezone fallback in that release. We can use the interface added in bug 1102295 to expose this for now.
Flags: needinfo?(benjamin)
Hardware: x86 → All
| Reporter | ||
Comment 8•11 years ago
|
||
I don't think we should actually use this until we've proofed it, probably by including the value in the telemetry ping and cross-checking it against geoIP for mismatches.
But yes, I will find somebody to get the API added.
Flags: needinfo?(benjamin)
Comment 9•11 years ago
|
||
Taking in account comment #8, we probably have this feature ready for 36. Tracking for 37.
| Assignee | ||
Updated•11 years ago
|
Assignee: nobody → aklotz
Status: NEW → ASSIGNED
| Reporter | ||
Comment 11•11 years ago
|
||
It's not a dup, but I don't know whether it's still wanted. This was Gavin's request.
Flags: needinfo?(benjamin) → needinfo?(gavin.sharp)
Comment 12•11 years ago
|
||
Flags: needinfo?(gavin.sharp)
| Assignee | ||
Comment 13•11 years ago
|
||
This uses the same interface that smichaud used for the Mac in bug 1102295 and adds Windows support.
Attachment #8561099 -
Flags: review?(jmathies)
Comment 14•11 years ago
|
||
I don't think this should be in nsIGfxInfo, it has nothing to do with graphics.
Comment 15•11 years ago
|
||
Gavin, shouldn't this move? Maybe we were in a rush or something in bug 1102295?
Flags: needinfo?(gavin.sharp)
Comment 16•11 years ago
|
||
Yes, we were in a rush in bug 1102295. And we may want to uplift this still, actually, so I think we should put it in nsIGfxInfo2 now, and we can clean both up later.
Flags: needinfo?(gavin.sharp)
Comment 17•11 years ago
|
||
> and we can clean both up later.
yeah right! :)
Comment 18•11 years ago
|
||
Comment on attachment 8561099 [details] [diff] [review]
Obtain the user GEOID
Review of attachment 8561099 [details] [diff] [review]:
-----------------------------------------------------------------
::: widget/windows/GfxInfo.cpp
@@ +28,5 @@
>
> #ifdef DEBUG
> NS_IMPL_ISUPPORTS_INHERITED(GfxInfo, GfxInfoBase, nsIGfxInfoDebug)
> +#else
> +NS_IMPL_ISUPPORTS_INHERITED(GfxInfo, GfxInfoBase, nsIGfxInfo2)
aren't you skipping adding support for the new interface in debug builds?
Attachment #8561099 -
Flags: review?(jmathies) → review+
| Assignee | ||
Comment 19•11 years ago
|
||
(In reply to Jim Mathies [:jimm] from comment #18)
> Comment on attachment 8561099 [details] [diff] [review]
> Obtain the user GEOID
>
> Review of attachment 8561099 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> ::: widget/windows/GfxInfo.cpp
> @@ +28,5 @@
> >
> > #ifdef DEBUG
> > NS_IMPL_ISUPPORTS_INHERITED(GfxInfo, GfxInfoBase, nsIGfxInfoDebug)
> > +#else
> > +NS_IMPL_ISUPPORTS_INHERITED(GfxInfo, GfxInfoBase, nsIGfxInfo2)
>
> aren't you skipping adding support for the new interface in debug builds?
Good catch, fixed before landing.
https://hg.mozilla.org/integration/fx-team/rev/f74a7a410dd3
Attachment #8561099 -
Attachment is obsolete: true
Attachment #8561701 -
Flags: review+
| Assignee | ||
Comment 20•11 years ago
|
||
(In reply to Jim Mathies [:jimm] from comment #17)
> > and we can clean both up later.
>
> yeah right! :)
Filed bug 1131325 ;-)
Component: XPCOM → Widget: Win32
Comment 21•11 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
status-firefox38:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla38
| Assignee | ||
Comment 22•11 years ago
|
||
Comment on attachment 8561701 [details] [diff] [review]
Obtain the user GEOID (r2)
Approval Request Comment
[Feature/regressing bug #]: Platform support for country id
[User impact if declined]: Chrome code won't be able to query for system country id on Windows.
[Describe test coverage new/current, TreeHerder]: Manually
[Risks and why]: None; code is self contained, uses existing interfaces already used by Mac implementation.
[String/UUID change made/needed]: None
Attachment #8561701 -
Flags: approval-mozilla-beta?
Attachment #8561701 -
Flags: approval-mozilla-aurora?
Comment 23•11 years ago
|
||
Gavin, you confirm that you want this patch in 36?
Flags: needinfo?(gavin.sharp)
Comment 24•11 years ago
|
||
Not needed for 36, but we should get it on 37.
Flags: needinfo?(gavin.sharp)
Updated•11 years ago
|
status-firefox34:
wontfix → ---
status-firefox35:
wontfix → ---
status-firefox36:
wontfix → ---
tracking-firefox34:
- → ---
tracking-firefox35:
- → ---
tracking-firefox36:
+ → ---
Comment 25•11 years ago
|
||
Comment on attachment 8561701 [details] [diff] [review]
Obtain the user GEOID (r2)
OK, thanks. Taking it for aurora only then
Attachment #8561701 -
Flags: approval-mozilla-beta?
Attachment #8561701 -
Flags: approval-mozilla-beta-
Attachment #8561701 -
Flags: approval-mozilla-aurora?
Attachment #8561701 -
Flags: approval-mozilla-aurora+
Comment 26•11 years ago
|
||
Unified_cpp_widget0.cpp
Unified_cpp_widget1.cpp
Unified_cpp_manager_boot_src0.cpp
c:\t1\hg\comm-central\mozilla\widget\GfxInfoBase.h(13) : fatal error C1083: Cannot open include file: 'nsIGfxInfo2.h': No such file or directory
c:/t1/hg/comm-central/mozilla/config/rules.mk:930: recipe for target 'Unified_cpp_widget0.obj' failed
mozmake[4]: *** [Unified_cpp_widget0.obj] Error 2
Comment 27•11 years ago
|
||
(In reply to Philip Chee from comment #26)
Needs-clobber.
status-firefox36:
--- → wontfix
Comment 28•11 years ago
|
||
Comment 29•11 years ago
|
||
I landed a trivial mingw fixup:
https://hg.mozilla.org/integration/mozilla-inbound/rev/5e50387c02f1
Comment 30•11 years ago
|
||
You need to log in
before you can comment on or make changes to this bug.
Description
•