Closed
Bug 550410
Opened 15 years ago
Closed 15 years ago
Provide preference to disable accelerometer.
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: dougt, Assigned: dougt)
References
Details
Attachments
(1 file)
2.77 KB,
patch
|
dveditz
:
review+
dveditz
:
approval1.9.2.4+
|
Details | Diff | Splinter Review |
Introduced in Gecko 1.9.2, we expose device orientation. We should provide a preference to disable this feature.
Assignee | ||
Comment 1•15 years ago
|
||
Attachment #430531 -
Flags: review?(dveditz)
Comment 2•15 years ago
|
||
Comment on attachment 430531 [details] [diff] [review] patch v.1 > // Initialize default render-mode. > pref("mozilla.widget.render-mode", -1); > > // Enable/Disable the geolocation API for content > pref("geo.enabled", true); > >+// Enable/Disable the orientation API for content >+pref("accelerometer.enabled", true); I don't feel strongly about it, but better pref namespacing could prevent future clashes. I'm more worried about the generic "geo." than the one you're actually adding here. It seems like both of those belong under the same root. Dunno if that's some dom. or other platform-like name, or generic mozilla. as in the widget case above. >+ PRBool bvalue; >+ rv = prefSrv->GetBoolPref("accelerometer.enabled", &bvalue); >+ if (NS_SUCCEEDED(rv) && bvalue == PR_FALSE) >+ mEnabled = PR_FALSE; > } Slightly simpler to do rv = prefSrv->GetBoolPref("accelerometer.enabled", &bvalue); if (NS_SUCCEEDED(rv)) mEnabled = bvalue; or even more middleman removal (at the cost of readability): if (NS_SUCCEEDED(prefSrv->GetBoolPref("accelerometer.enabled". &bvalue))) mEnabled = bvalue; I guess you're not in code where you can use nsContentUtils::GetBoolPref()? mEnabled = nsContentUtils::GetBoolPref("accelerometer.enabled", PR_TRUE); All in the nature of nits, change them or not if you wish. r=dveditz
Attachment #430531 -
Flags: review?(dveditz) → review+
Assignee | ||
Comment 3•15 years ago
|
||
http://hg.mozilla.org/mozilla-central/rev/843e68865dea
Assignee | ||
Updated•15 years ago
|
Attachment #430531 -
Flags: approval1.9.2.3?
Assignee | ||
Updated•15 years ago
|
blocking1.9.2: --- → ?
Comment 4•15 years ago
|
||
Not blocking, but I bet we'll take the patch. It can haz tests?
blocking1.9.2: ? → -
status1.9.2:
--- → wanted
Assignee | ||
Comment 5•15 years ago
|
||
no automated tests. our testing hardware doesn't have accelerometers. We should add a litmus test though.
Flags: in-litmus?
Comment 6•15 years ago
|
||
Comment on attachment 430531 [details] [diff] [review] patch v.1 Approved for 1.9.2.3, a=dveditz
Attachment #430531 -
Flags: approval1.9.2.3? → approval1.9.2.3+
Assignee | ||
Comment 7•15 years ago
|
||
http://hg.mozilla.org/releases/mozilla-1.9.2/rev/45a5b2dfb738
Updated•13 years ago
|
Assignee: nobody → doug.turner
Assignee | ||
Updated•10 years ago
|
Flags: in-litmus?
Updated•5 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•