To show geolocation usage in the left-hand indicator. We need to expose
it to PageSpecifiedContentSetting.
In this CL, this usage information is exposed with the same method as
HID/bluetooth with the web contents observer.
Change-Id: I730547e07955cd07913c49e92abd6ce01bbde05d
Bug: 372836924
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5920698
Reviewed-by: Alexander Timin <altimin@chromium.org>
Reviewed-by: Elias Klim <elklm@chromium.org>
Reviewed-by: Matt Reynolds <mattreynolds@chromium.org>
Commit-Queue: Yifan Luo <lyf@chromium.org>
Reviewed-by: Francois Pierre Doray <fdoray@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1372239}
This CL adds metrics for evaluating internal usage of location
providers, in particular providers that send network requests to
the geolocation web service.
Geolocation.NetworkLocationRequest.Source is recorded whenever a
geolocation network request is sent by any provider, and records the
provider that initiated the request.
Geolocation.GeolocationImpl.ClientId and
Geolocation.PublicIpAddressGeolocator.ClientId are recorded when
a new position estimate is requested from GeolocationImpl or
PublicIpAddressGeolocator. The recorded value identifies the client
that created the GeolocationImpl or PublicIpAddressGeolocator.
Change-Id: I096cc3ad856a30f5fa81e4c3694ce623b87ee52a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5367006
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Reviewed-by: Stephen McGruer <smcgruer@chromium.org>
Commit-Queue: Matt Reynolds <mattreynolds@chromium.org>
Reviewed-by: Anthony Cui <cuianthony@chromium.org>
Reviewed-by: Mustafa Emre Acer <meacer@chromium.org>
Reviewed-by: James Cook <jamescook@chromium.org>
Reviewed-by: Dibyajyoti Pal <dibyapal@chromium.org>
Code-Coverage: findit-for-me@appspot.gserviceaccount.com <findit-for-me@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#1313671}
The PEPC element needs to get the overall permission status including
the device status in order to correctly decide which text to present
to the user. This CL ensures that the PEPC observer will receive the
permission status including the device status, while not changing the
functionality for other observers. This is done by adding a new
parameter to the `AddObserver` call: `should_include_device_status`.
This parameter is trickled all the way down to the `PermissionManager`
where it is used when calculating the permission status for that
subscription only, whenever that is done.
*Reviewers*: This CL makes mechanical changes to many files, but the
only logical changes are:
* chrome_permissions_client.cc - implement OS device status interaction
for Mac
* components/permissions/permission_context_base.h - define new
`AlwaysIncludeDeviceStatus` function which allows the
`GeolocationPermissionContextAndroid` to keep its current functionality
* `components/permissions/permission_manager.cc` - use the new
`should_include_device_status` parameter to decide whether to include
the device status when getting the permission status.
* html_permission_element.cc - make the AddObserver call with
`should_include_device_status` = true
Fixed: 335834559
Change-Id: Ia8cf68010c9b596520a6b4c5fc61ad24577452f9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5483406
Reviewed-by: Peter Beverloo <peter@chromium.org>
Reviewed-by: David Song <wintermelons@google.com>
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Reviewed-by: Ted Choc <tedchoc@chromium.org>
Reviewed-by: Peter Kvitek <kvitekp@chromium.org>
Reviewed-by: Thomas Nguyen <tungnh@chromium.org>
Reviewed-by: Antonio Sartori <antoniosartori@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Andy Paicu <andypaicu@chromium.org>
Reviewed-by: Sean Topping <seantopping@chromium.org>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Reviewed-by: Mason Freed <masonf@chromium.org>
Reviewed-by: Aaron Leventhal <aleventhal@chromium.org>
Reviewed-by: Eugene Zemtsov <eugene@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1299563}
This CL aligns the class name 'GeolocationSystemPermissionManager' with
its focused functionality as part of the ongoing `GeolocationManager`
refactoring. Previously, `GeolocationManager` handled both location
updates and system permission management. This refactoring streamlines
responsibilities and improves code readability.
Bug: 41496017
Change-Id: I7cd2e76b9e37f32df5c7e739cbc405f4e9c376c0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5354161
Reviewed-by: Eric Seckler <eseckler@chromium.org>
Reviewed-by: Matt Reynolds <mattreynolds@chromium.org>
Reviewed-by: Peter Beverloo <peter@chromium.org>
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Commit-Queue: Alvin Ji <alvinji@chromium.org>
Reviewed-by: James Cook <jamescook@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1272449}
Patch crrev.com/c/5119918 removed a call to TrackGeolocationAttempted
from content/browser/geolocation/geolocation_service_impl.cc
This call has a side effect on iOS (calling RequestPermission()) that was not supposed to be removed.
We are putting the RequestPermission call back for iOS.
Bug: b/312485657
Change-Id: I9f69eb79cb45dac50068a878196ec816a8bafef3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5177615
Commit-Queue: Jan Láník <janlanik@google.com>
Reviewed-by: Matt Reynolds <mattreynolds@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1246407}
Browser should not trigger system level notifications for geolocation
access on ChromeOS. We are using the standard browser surfaces
to communicate that the geolocation is off and the OS notification
is therefore superfluous.
Bug: b/312485657
Change-Id: I5eef88db1956dddbaee5508423dda62d51cf0ef7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5119918
Reviewed-by: Matt Reynolds <mattreynolds@chromium.org>
Commit-Queue: Matt Reynolds <mattreynolds@chromium.org>
Reviewed-by: Ahmed Fakhry <afakhry@chromium.org>
Auto-Submit: Jan Láník <janlanik@google.com>
Cr-Commit-Position: refs/heads/main@{#1244313}
To better indicate what is being subscribed to what, rename:
SubscribePermissionStatusChange
-> SubscribeToPermissionStatusChange
UnsubscribePermissionStatusChange
-> UnsubscribeFromPermissionStatusChange
Bug: 1510841
Change-Id: Idb7597d7d7a7b8f3ba32b7ed917de2c68290587a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5115241
Reviewed-by: Avi Drissman <avi@chromium.org>
Owners-Override: Avi Drissman <avi@chromium.org>
Commit-Queue: Balazs Engedy <engedy@chromium.org>
Reviewed-by: Elias Klim <elklm@chromium.org>
Commit-Queue: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1236465}
Previously, once a site obtained a geolocation watch (either through an already existing grant or through a new permission prompt flow), it kept receiving location updates in the registered watch callback within the same session (i.e. for as long as the user didn't close the tab or performed a navigation). This remained the case, even after the grant was revoked. This CL fixes this behaviour.
Bug: 1462313
Change-Id: I3151beb1a05bcf7169e952e908b67ae9dbcf7105
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4853341
Reviewed-by: Matt Reynolds <mattreynolds@chromium.org>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Commit-Queue: Reilly Grant <reillyg@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1197210}
PermissionControllerImpl is typically owned by the BrowserContext that it has a raw_ptr for. However GeolocationServiceTest broke that assumption, causing the raw_ptr to be dangling. This CL fixes that.
Bug: 1471082
Change-Id: I20c69de36e238dc7ce71bec64802d996cc4cc275
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4852425
Reviewed-by: Ravjit Uppal <ravjit@chromium.org>
Commit-Queue: Takumi Fujimoto <takumif@chromium.org>
Reviewed-by: Matt Reynolds <mattreynolds@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1196870}
This reverts commit d02d575ab5.
Reason for revert: returns "permission was revoked" error even after
permission is granted (crbug.com/1475743)
Original change's description:
> Stop geolocation watch updates upon permission revocation
>
> Previously, once a site obtained a geolocation watch (either through an already existing grant or through a new permission prompt flow), it kept receiving location updates in the registered watch callback within the same session (i.e. for as long as the user didn't close the tab or performed a navigation). This remained the case, even after the grant was revoked. This CL fixes this behaviour.
>
> Bug: 1462313
>
> Change-Id: I3eef70bb8f5aad3f5bfc2554f429312acd238bf5
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4668727
> Reviewed-by: Avi Drissman <avi@chromium.org>
> Commit-Queue: Florian Jacky <fjacky@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1177378}
Bug: 1462313
Change-Id: Ib9c7816fd85397bd58f0ebe355ff10b79daeaa2e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4811298
Commit-Queue: Matt Reynolds <mattreynolds@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1188049}
Previously, once a site obtained a geolocation watch (either through an already existing grant or through a new permission prompt flow), it kept receiving location updates in the registered watch callback within the same session (i.e. for as long as the user didn't close the tab or performed a navigation). This remained the case, even after the grant was revoked. This CL fixes this behaviour.
Bug: 1462313
Change-Id: I3eef70bb8f5aad3f5bfc2554f429312acd238bf5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4668727
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Florian Jacky <fjacky@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1177378}
The DanglingPointerDetector is configured only when the test enters the
ContentMain function. See https://crbug.com/1400059
I would like to configure it no matter the kind of test. For this to
happen, we need to annotate every pre-existing dangling pointers.
This patch annotates the ones you can find by running targets depending
on the GoogleTest library.
Statistic:
This adds 1776 new DanglingUntriaged. Among them:
- 1288 are in unittests.
- 488 are in implementation.
To produce those numbers, I used the command:
```bash
git diff annotate-linux origin/main -- "*test*" | grep "DanglingUntriaged" | wc -l
```
This patch has been generated by:
1. Apply the "auto-annotator" patch:
https://chromium-review.googlesource.com/c/chromium/src/+/4474553
2. Compile the compiler again:
```bash
./tools/clang/scripts/build.py
```
3. List and run all the targets. You can use a bash script like:
https://docs.google.com/document/d/1AMMERcqy0eafFWopUCHYsIKIKEp3J8DFxqW9UIbzIHo
4. Concatenate output, filter by "Found dangling ptr", sort, remove
duplicate.
5. Apply the rewriter script from:
https://github.com/ArthurSonzogni/chrome-dangling-ptr-apply-edit
6. Revert the "auto-annotate" patch.
7. Apply `git cl format`
AX-Relnotes: n/a.
Bug: chromium:1400059
Change-Id: I217d5c0b925da5176fc53baf95919a3690f1e9a3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4570424
Reviewed-by: danakj <danakj@chromium.org>
Owners-Override: danakj <danakj@chromium.org>
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1151859}
*No functionality changes in this CL*
We're expanding the range of wildcards available in the near future, but
before that we should take a second and shore up the integrity of
OriginWithPossibleWildcards itself.
First, it should be a class so that we can make its data private.
Second, we should push production code to use FromOrigin or Parse as the
entry points, and add a new test-only function
(FromOriginAndWildcardsForTest) that allows custom wildcards to be set
for convenience.
Bug: 1418009
Change-Id: I4eeea4a4fbbd8a143faa1cf5e39c22c25fe8ab4f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4562637
Owners-Override: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Auto-Submit: Ari Chivukula <arichiv@chromium.org>
Commit-Queue: Ari Chivukula <arichiv@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1149029}
In order to migrate to using the underlying CSP wildcard matching logic
(even if we don't expand the wildcard options available) we need to
prevent opaque origins from ending up in the allowlist as CSP matching
does not support them. This isn't a big issue as the only origin that
can be opaque is `self`, so we can just split that out in the policy
itself as an optional datatype.
This touches a lot of code, but is heavily tested and the new DCHECKS in
OriginWithPossibleWildcards should ensure self was properly moved.
This CL is part of a series:
(1) Ban opaque origins from OriginWithPossibleWildcard
(2) Switch to using underlying CSP data type
(3) Use CSP parsing and comparison paths
Bug: 1418009
Change-Id: Ib35511b741f3168d9f28618fcb3eb8b8f3eb8f2a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4317285
Owners-Override: Daniel Cheng <dcheng@chromium.org>
Auto-Submit: Ari Chivukula <arichiv@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Ian Clelland <iclelland@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1120662}
Turns out there's a lot of includes, so these will have to be removed
before deleting the implementation of the task runner handles.
To allow the deletion of the task runner handle headers, add
the sequenced/thread task runner handles where they are used in
the codebase with scripts.
This was done with an automated change, with a few touchups afterwards.
The code for the mass-refactor changes are here:
python:
https://paste.googleplex.com/5534570878337024
shell:
https://paste.googleplex.com/6466750748033024
In terms of touchups:
- add sequenced/thread task runner handles to
the third_party/blink/public/DEPS, because multiple files were using
it transitively anyways.
- rewrite certain parts of the codebase which used
ThreadTaskRunnerHandles instead of CurrentDefaultHandles.
- fix a compile issue with forward-declaration in
extensions/browser/extension_file_task_runner.h.
AX-Relnotes: n/a.
Bug: 1026641
Change-Id: I737ef32aee4e77c21eaa3a2bdc403a28322cf1b7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4133323
Owners-Override: Gabriel Charette <gab@chromium.org>
Commit-Queue: Sean Maher <spvw@chromium.org>
Commit-Queue: Gabriel Charette <gab@chromium.org>
Reviewed-by: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1090532}
PermissionManager contains duplicated methods that differentiate by permissions type enum (ContentSettingsType vs PermissionType). This CL removed most of the ContentSettingsType-related methods, because they had limited usage, mostly in tests.
Methods removed from PermissionManager:
* RequestPermission(ContentSettingsType)
* RequestPermissions(ContentSettingsType)
* RequestPermissionFromCurrentDocument
(ContentSettingsType)
* PermissionManager::RequestPermissionsFromCurrentDocument
(ContentSettingsType)
* GetPermissionStatusForFrame(ContentSettingsType)
* GetPermissionStatusForWorker(ContentSettingsType)
* GetPermissionStatusForFrame(PermissionType)
Methods removed from PermissionControllerDelegate:
* GetPermissionStatusForFrame(PermissionType)
Methods added to PermissionControllerDelegate:
* RequestPermissionsFromCurrentDocument(PermissionType)
Methods added to PermissionManager:
* RequestPermissionsFromCurrentDocument(PermissionType)
Bug: 1271543
Change-Id: I7c718e3a1a390cd5be6f143ad8f7a07477473e3a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3599030
Reviewed-by: Sergey Ulanov <sergeyu@chromium.org>
Commit-Queue: Peter Kvitek <kvitekp@chromium.org>
Reviewed-by: Ravjit Uppal <ravjit@chromium.org>
Reviewed-by: Sean Topping <seantopping@chromium.org>
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Commit-Queue: Illia Klimov <elklm@google.com>
Reviewed-by: Michael Bai <michaelbai@chromium.org>
Reviewed-by: Florent Castelli <orphis@chromium.org>
Reviewed-by: Peter Kvitek <kvitekp@chromium.org>
Quick-Run: Peter Kvitek <kvitekp@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1002151}
This inlines all remaining DISALLOW_* macros in content/. This is done
manually (vim regex + manually finding insertion position).
IWYU cleanup is left as a separate pass that is easier when these macros
go away.
Bug: 1010217
Change-Id: I8b5ea6dd9f8a3f584cf3eef82634017a38b15be8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3193883
Commit-Queue: Peter Boström <pbos@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Auto-Submit: Peter Boström <pbos@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Owners-Override: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/main@{#936160}
This replaces DISALLOW_COPY_AND_ASSIGN with explicit constructor deletes
where a local script is able to detect its insertion place (~Foo() is
public => insert before this line).
This is incomplete as not all classes have a public ~Foo() declared, so
not all DISALLOW_COPY_AND_ASSIGN occurrences are replaced.
IWYU cleanup is left as a separate pass that is easier when these macros
go away.
Bug: 1010217
Change-Id: Iea478401b7580682c7b9f195f7af9cbbdb6ce315
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3167292
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Owners-Override: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Peter Boström <pbos@chromium.org>
Cr-Commit-Position: refs/heads/main@{#923194}
This CL is part of MPArch tasks and let GeolocationServiceImpl grab the
origin from RenderFrameHost rather than WebContents.
A test in case of prerendering is added, because permission of
geolocation should be requested after the prerendered page is activated.
Change-Id: I74ed0dccf5069449af00ae34498720884711eeb2
Bug: 1229110
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3026388
Reviewed-by: Lucas Gadani <lfg@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Yeunjoo Choi <ychoi@igalia.com>
Cr-Commit-Position: refs/heads/master@{#903733}
This CL refactors non-overridable (i.e. implemented only within
//content) methods of `BrowserContext`, so that they are implemented as
instance methods (rather than as `static` methods taking a `self`
argument). This particular CL refactors the following methods:
- GetPermissionController
- SetPermissionControllerForTesting
For the rationale/motivation for this change, please see the CL
description of an earlier CL in this series - r877482.
Bug: 1179776
Change-Id: I6a1db0761479e23a5e876b922aefe6b39d28945e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2893227
Commit-Queue: Charlie Reis <creis@chromium.org>
Auto-Submit: Łukasz Anforowicz <lukasza@chromium.org>
Reviewed-by: Charlie Reis <creis@chromium.org>
Owners-Override: Charlie Reis <creis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#882817}
This CL does a global replace on
mojom::FeaturePolicyFeature => mojom::PermissionsPolicyFeature
blink::FeaturePolicyFeatureState => blink::PermissionsPolicyFeatureState
Note: histogram enum FeaturePolicyFeature is untouched.
Bug: 1123116
Change-Id: Ib3373f24363558ae07d240663815a421f143bd85
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2705646
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Ian Clelland <iclelland@chromium.org>
Owners-Override: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Charlie Hu <chenleihu@google.com>
Cr-Commit-Position: refs/heads/master@{#859858}
This CL renames 'feature_policy' in file names to 'permissions_policy'
with 2 exceptions:
- dom_feature_policy
- feature_policy_violation_report_body
Both files are closely related to V8 bindings. Changing the file name
would require change to class name defined in the file.
Bug: 1123116
Change-Id: I17968f745fa983df30dcf94fe37c6b4b91616f1e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2704785
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Ian Clelland <iclelland@chromium.org>
Owners-Override: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Charlie Hu <chenleihu@google.com>
Cr-Commit-Position: refs/heads/master@{#859569}
With an upcoming change to Feature/Permissions Policy, the header
alone will no longer be sufficient to delegate permissions to use
powerful features in subframes. The iframe allow attribute must
be used in conjunction with it. The header can still be used to
block delegation.
This change updates the permission delegation unit tests to use the
allow attribute when delegating permissions to cross-origin frames.
Bug: 1095641
Change-Id: I47d6ab6ed04fdc75b2a7f51581f7213f6411cf89
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2424635
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Balazs Engedy <engedy@chromium.org>
Commit-Queue: Balazs Engedy <engedy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#812174}
This CL adds the ability of delegation geolocation data from TWA.
If runningTWA (and location delegation enabled), GeolocationServiceImpl
will bind the geolocation via installed_webapp_context instead of the
geolocation_context_ in services/device/
For each new binding, InstalledWebappGeolocationContext will create an
InstalledWebappGeolocationBridge. the "bridge" class is a impl of the
device::mojom::Geolocation mojo interface. It's similar to
services/device/geolocation/geolocation_impl.cc
The bridge class also serve as jni that connect with the java part.
The java part is adding in following CL: crrev.com/c/2212455.
Detail see design doc:
https://docs.google.com/document/d/1oWZmJBXL2m_XqiJs6gDNzyky5mDml28b0LO6CQ5kFfE/edit
Change-Id: I2e83d7f620f2d202b4bc77d0b04d876a032adaf5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2210487
Commit-Queue: Ella Ge <eirage@chromium.org>
Reviewed-by: Peter Conn <peconn@chromium.org>
Reviewed-by: Yaron Friedman <yfriedman@chromium.org>
Reviewed-by: Dominick Ng <dominickn@chromium.org>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#775588}