Closed
Bug 1264835
Opened 9 years ago
Closed 9 years ago
No way to set doorhanger checkbox default off
Categories
(Firefox for Android Graveyard :: General, defect)
Firefox for Android Graveyard
General
Tracking
(firefox50 fixed)
RESOLVED
FIXED
Firefox 50
| Tracking | Status | |
|---|---|---|
| firefox50 | --- | fixed |
People
(Reporter: mchiang, Assigned: enr0n, Mentored)
References
Details
(Whiteboard: [lang=java][good next bug])
Attachments
(1 file, 1 obsolete file)
|
1.46 KB,
patch
|
sebastian
:
review+
|
Details | Diff | Splinter Review |
For getusermedia permission granting & blocking, we want to grant as little persistent permissions as possible. So we need to set the doorhanger checkbox default off.
Comment 1•9 years ago
|
||
We allow to set the text but not the default state:
https://dxr.mozilla.org/mozilla-central/source/mobile/android/base/java/org/mozilla/gecko/widget/DefaultDoorHanger.java#124-127
Mentor: s.kaspari
Whiteboard: [lang=java][good next bug]
| Assignee | ||
Comment 2•9 years ago
|
||
So do we want to allow for the default state of the checkbox to be passed in with options? Or are we just assuming a default of unchecked?
Flags: needinfo?(s.kaspari)
Comment 3•9 years ago
|
||
We should allow the default state to be passed in.
Flags: needinfo?(s.kaspari)
| Assignee | ||
Comment 4•9 years ago
|
||
Here's my first try at it.
Attachment #8762766 -
Flags: review?(s.kaspari)
Updated•9 years ago
|
Assignee: nobody → nrosbrook
Status: NEW → ASSIGNED
Comment 5•9 years ago
|
||
Comment on attachment 8762766 [details] [diff] [review]
Patch attempt 1
Review of attachment 8762766 [details] [diff] [review]:
-----------------------------------------------------------------
This is looking good! I think with the little change below we can land this. Did you test this?
We have a test for some doorhangers here:
https://dxr.mozilla.org/mozilla-central/source/mobile/android/tests/browser/robocop/src/org/mozilla/gecko/tests/testDoorHanger.java
Maybe you can use this to write a new test just for the checkbox state?
::: mobile/android/base/java/org/mozilla/gecko/widget/DefaultDoorHanger.java
@@ +131,5 @@
> + if (options.has("checkboxState")) {
> + final boolean checkBoxState = options.optBoolean("checkboxState");
> + mCheckBox = (CheckBox) findViewById(R.id.doorhanger_checkbox);
> + mCheckBox.setChecked(checkBoxState);
> + mCheckBox.setVisibility(VISIBLE);
I wonder if we should move this inside the checkboxText block: I guess it only makes sense to set the default for the checkbox if we are actually going to display a checkbox *with* text. This also avoids some of the code because we do not need to search the view again and update the visibility.
Attachment #8762766 -
Flags: review?(s.kaspari) → feedback+
| Assignee | ||
Comment 6•9 years ago
|
||
Here's the patch with the suggested fix. I'll try to write the test for it--but here's the patch itself for now.
Attachment #8762766 -
Attachment is obsolete: true
Attachment #8763724 -
Flags: review?(s.kaspari)
Comment 7•9 years ago
|
||
Comment on attachment 8763724 [details] [diff] [review]
Patch attempt 2
LGTM!
Attachment #8763724 -
Flags: review?(s.kaspari) → review+
Comment 8•9 years ago
|
||
Comment 9•9 years ago
|
||
Let's get this into the tree (Adding checkin-needed..).
@Nicholas: If you write a UI test for this then just file a new bug, attach the patch and assign me for review. :)
Keywords: checkin-needed
| Assignee | ||
Comment 10•9 years ago
|
||
@Sebastian: Okay, sounds good!
Comment 11•9 years ago
|
||
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/fx-team/rev/a5e39700fd44
Updated DefaultDoorHanger so that the default CheckBox state could be specified as an option. r=sebastian
Keywords: checkin-needed
Comment 12•9 years ago
|
||
| bugherder | ||
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
status-firefox50:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 50
Updated•5 years ago
|
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•