-
Notifications
You must be signed in to change notification settings - Fork 868
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Informs to users about system location service #19529
Conversation
2173a24
to
7ed867a
Compare
7ed867a
to
e2d2ecd
Compare
6bcab7e
to
738e19e
Compare
I know it's a WIP - but just pulled the code 🙂 This is looking nice!
|
@bsclifton Thanks for testing! I'm updating dialog UI (https://www.figma.com/file/tU9zrk9Ite8B06JSjHAHhn/General-dialogs-and-popups?type=design&node-id=113-17205&mode=design&t=ReAGaEUCCkOSD3OC-0) |
187bbdb
to
778df10
Compare
7c23e41
to
44e28c6
Compare
Found another issue with current PR. After closing helper dialog, permission request bubble is shown. |
@goodov it's not ready yet to ask review as this PR introduced regression . but can you give early reivew about this PR's approach for launching another dialog before showing geolocation permission bubble? I used nested loop to block permission bubble launching. |
having do we really want to add a separate nagging window before the permission popup? This doesn't look as a great UX tbh. cc @pes10k ? |
44e28c6
to
78cad9d
Compare
Yup, I think this causes some regressions. Trying to find another way to avoid it. |
adf4401
to
a2dce0c
Compare
fix brave/brave-browser#16897 If system location service is enabled, browser can get more accurate geolocation data. Launch dialog about this when site asks geolocation permission if system location service is not yet enabled.
a2dce0c
to
22d1ccc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
dialog_asked_in_current_navigation_ = true; | ||
is_dialog_running_ = true; | ||
brave::ShowGeolocationAccuracyHelperDialog( | ||
web_contents(), | ||
base::BindOnce(&GeolocationAccuracyTabHelper::OnDialogClosed, | ||
weak_ptr_factory_.GetWeakPtr())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it better to move this into IS_WIN guard together? I know this tab helper won't be populated on other platforms but just in case.
bool IsSystemLocationSettingEnabled(); | ||
void LaunchLocationServiceSettings(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need namespace here as these plain functions are global namespace.
constexpr char kShowGeolocationAccuracyHelperDialog[] = | ||
"brave.show_geolocation_accuracy_helper_dialog"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
class Checkbox; | ||
} // namespace views | ||
|
||
class GeolocationAccuracyHelperDialogView : public views::DialogDelegateView { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
optional: From my experience, when having modal window, using constrained_window could be a good choice as it provides more functionality to make it sure that the modal dialog is visible to users, such as restoring window when it's minimized.
<message name="IDS_GEOLOCATION_ACCURACY_HELPER_DLG_CONTENTS_LABEL" desc="The text for content part in the dialog"> | ||
The Brave browser is attempting to access your location. You may not get accurate results unless you enable your operating system's <ph name="PART_ONE">$1<ex>Location services</ex></ph> setting and also enable <ph name="PART_TWO">$2<ex>Let apps access your location</ex></ph>. | ||
</message> | ||
<message name="IDS_GEOLOCATION_ACCURACY_HELPER_DLG_CONTENTS_PART_ONE_LABEL" desc="The text for content part one in the dialog"> | ||
Location services | ||
</message> | ||
<message name="IDS_GEOLOCATION_ACCURACY_HELPER_DLG_CONTENTS_PART_TWO_LABEL" desc="The text for content part two in the dialog"> | ||
Let apps access your location | ||
</message> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doing this is not great for localization. Not sure if this is doable, but would it be possible to use two placeholders for each fragment just to get offsets? For example:
<message name="IDS_GEOLOCATION_ACCURACY_HELPER_DLG_CONTENTS_LABEL" desc="The text for content part in the dialog"> The Brave browser is attempting to access your location. You may not get accurate results unless you enable your operating system's <ph name="STYLE_ONE_BEGIN">$1</ph>Location services<ph name="STYLE_ONE_END">$2</ph> setting and also enable <ph name="STYLE_TWO_BEING">$3</ph>Let apps access your location<ph name="STYLE_TWO_END">$4</ph>. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Extra line breaks for visibility in GitHub
Then use l10n_util::GetStringFUTF16
to get all the offsets and apply styling to ranges in between _BEGIN and _END offsets. I guess we can replace placeholders themselves with empty strings, if necessary. WDYT?
Changed to draft as we could change UI. cc @rebron |
Closed as we'll add more information to geolocation permission bubble instead of another dialog. |
fix brave/brave-browser#16897
If system location service is enabled, browser can get more accurate geolocation data.
Launch dialog about this when site asks geolocation permission if system location service is not yet enabled.
NOTE: focus ring color should be handled separately.
Resolves
Submitter Checklist:
QA/Yes
orQA/No
;release-notes/include
orrelease-notes/exclude
;OS/...
) to the associated issuenpm run test -- brave_browser_tests
,npm run test -- brave_unit_tests
wikinpm run lint
,npm run presubmit
wiki,npm run gn_check
,npm run tslint
git rebase master
(if needed)Reviewer Checklist:
gn
After-merge Checklist:
changes has landed on
Test Plan:
GeolocationAccuracyBrowserTest.DialogLaunchTest
Location services
fromPrivacy & security
settingsOk
,Privacy & Secury
>Location
setting page is openedDon't show again
checkbox