-
Notifications
You must be signed in to change notification settings - Fork 871
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
Update Geolocation permission bubble #23278
Conversation
296ad10
to
d3f8d1e
Compare
d3f8d1e
to
7fda375
Compare
chromium_src/chrome/browser/ui/views/permissions/permission_prompt_bubble_base_view.cc
Outdated
Show resolved
Hide resolved
a33f5d5
to
b8053f4
Compare
If permission bubble knows about whether web site requested geolocation with high accuracy or not, Renderer uses |
b806613
to
13a8954
Compare
5e8c3e9
to
00613e0
Compare
|
657dd2c
to
55e3e34
Compare
Geolocation permission bubble consdiers enableHighAccuracy bit.
Browser could be nullptr.
Co-authored-by: Brian Clifton <brian@clifton.me>
kCLAuthorizationStatusAuthorized is deprecated.
dd5d9ab
to
e4ad5fa
Compare
280d448
to
98f92e0
Compare
</message> | ||
<message name="IDS_GEOLOCATION_PERMISSION_BUBBLE_HIGH_ACCURACY_WITHOUT_LOCATION_SERVICE_LABEL" desc="The text for geolocation permission bubble with high accuracy"> | ||
This site has requested your <ph name="PART_ONE">$1</ph>precise location<ph name="PART_ONE_END">$2</ph>. Brave will only able to provide <ph name="PART_TWO">$3</ph>general location<ph name="PART_TWO_END">$4</ph> data due to <ph name="PART_THREE">$5</ph>Location Services<ph name="PART_THREE_END">$6</ph> being disabled. <ph name="PART_FOUR">$7</ph>Learn more<ph name="PART_FOUR_END">$8</ph> | ||
</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.
I was thinking of using placeholders like so, but maybe that's not the best way, I'm not sure.
IDS_GEOLOCATION_PERMISSION_BUBBLE_REQUESTED_LOCATION_TYPE_LABEL:
This site has requested your <ph name="LOCATION_TYPE">$1<ex>general location</ex></ph>. <ph name="LEARN_MORE">$2<ex>Learn more</ex></ph>.
IDS_GEOLOCATION_PERMISSION_BUBBLE_LOCATION_TYPE_GENERAL desc="Used as a placeholder replacement in IDS_GEOLOCATION_PERMISSION_BUBBLE_REQUESTED_LOCATION_TYPE_LABEL":
general location
IDS_GEOLOCATION_PERMISSION_BUBBLE_LOCATION_TYPE_PRECISE desc="Used as a placeholder replacement in IDS_GEOLOCATION_PERMISSION_BUBBLE_REQUESTED_LOCATION_TYPE_LABEL":
precise location
IDS_GEOLOCATION_PERMISSION_BUBBLE_REQUESTED_LOCATION_TYPE_WITHOUT_LOCATION_SERVICE_LABEL:
Brave will only able to provide <ph name="LOCATION_TYPE">$1<ex>general location</ex></ph> data due to <ph name="LOCATION_SERVICES">$2<ex>Location Services</ex></ph> being disabled. <ph name="LEARN_MORE">$2<ex>Learn more</ex></ph>
IDS_GEOLOCATION_PERMISSION_BUBBLE_LOCATION_SERVICES:
Location Services
chromium_src/chrome/browser/ui/views/permissions/permission_prompt_bubble_base_view.cc
Show resolved
Hide resolved
|
||
export_class_attribute_blink = "CORE_EXPORT" | ||
export_define_blink = "BLINK_CORE_IMPLEMENTATION=1" | ||
export_header_blink = "third_party/blink/renderer/core/core_export.h" |
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.
please remove these export variables and add brave_geolocation_permission_blink
directly into blink core via brave_blink_renderer_core_deps
.
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.
Addressed via 17ba984 but it seems above defines are needed.
Got build failure w/o them.
[puLL-Merge] - brave/brave-core@23278 DescriptionThis PR adds more detailed informational text to the geolocation permission request dialog. The text varies depending on if the user has requested high accuracy location and if the system location services are enabled. It also includes a "Learn more" link to platform-specific documentation about location services. ChangesChanges
Security Hotspots
The changes overall look safe and well-contained. The main security consideration is ensuring the platform-specific code cannot enable location access improperly. The Mojo usage also warrants a careful review, but follows established patterns. Adding tests is good to see for a user-facing change like this. |
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.
Tried the different states - each worked great 😄👍
Nice cleanup on the placeholders too - thanks @goodov for the help
It's finally fixed. thanks all for great review! |
Great thanks to you, @simonhong , for taking this humongous activity up. It has been as huge to fix as useful it is to end-users. |
@@ -797,6 +797,10 @@ | |||
You're viewing a WebTorrent page | |||
</message> | |||
|
|||
<message name="IDS_TEST_STRING_FOR_PLACEHOLDERS" desc="Only for test purpose. Don't need to translate"> |
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.
@simonhong, you can use translateable="false"
attribute in the future if the string doesn't need to be translated.
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.
Got it, thanks!
fix brave/brave-browser#16897
Added more information to users for getting precise location.
With passed
enableHighAccuracy
, permission bubble could give more precise info.When page requests current position w/o
highAccuracy
, below bubble should shown.[Type A]
When page requests current position with
highAccuracy
, we have two types of bubble.When os location service is enabled, below bubble is shown
[Type B]
When os location service is disabled, this is shown.
[Type C]
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 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:
GeolocationPermissionRequestBrowserTest.SetEnabledHighAccuracyTest
LocalizationUtilTest.GetLocalizedResourceUTF16StringWithPlaceholders
NOTE: geolocation permission bubble is not changed on Linux
navigator.geolocation.getCurrentPosition(() => {}, () => {}, { enableHighAccuracy : false });
navigator.geolocation.getCurrentPosition(() => {}, () => {}, { enableHighAccuracy : true });
navigator.geolocation.getCurrentPosition(() => {}, () => {}, { enableHighAccuracy : true });