0
Commit Graph

446 Commits

Author SHA1 Message Date
Yifan Luo
8e5d3d5f9c [Geolocation LHS] Add geolocation to web content observer
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}
2024-10-22 19:18:16 +00:00
Alvin Ji
7ae22ce301 Add alvinji@chromium.org to Geolocation OWNERS
Change-Id: Idd1402ada457c83223efa7ce9641e2d7312a25f9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5874197
Reviewed-by: Matt Reynolds <mattreynolds@chromium.org>
Commit-Queue: Alvin Ji <alvinji@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1357409}
2024-09-19 00:01:47 +00:00
Owners Cleanup
315bcffc52 Remove mcasas@chromium.org from content/browser/geolocation/OWNERS
This suggested change is automatically generated based on group
memberships and affiliations.
If this change is unnecessary or in error, vote the lowest CR value
(i.e. reject the CL) and the bot will abandon it. Vote the highest CR to
approve this change. You may also abandon this change.

See the owner's recent activity for context:
https://chromium-review.googlesource.com/q/mcasas@chromium.org

To report an issue, file a bug in the Infra>Codereview component.

Change-Id: I89e644894d1a5692d93f242e9de9a5f2328d6a00
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5800667
Auto-Submit: Owners Cleanup <swarming-tasks@owners-cleanup-prod.google.com.iam.gserviceaccount.com>
Commit-Queue: Matt Reynolds <mattreynolds@chromium.org>
Reviewed-by: Matt Reynolds <mattreynolds@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1344380}
2024-08-20 20:59:51 +00:00
Matt Reynolds
9e5062941f geolocation: Record geolocation client metrics
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}
2024-06-11 21:27:56 +00:00
Andy Paicu
9d70da4c58 [PEPC] Make PEPC permission subscription take into account device status
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}
2024-05-10 22:24:39 +00:00
Alvin Ji
0ff2727779 Rename GeolocationManager to GeolocationSystemPermissionManager
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}
2024-03-13 21:57:27 +00:00
Jeff Yoon
d1328c4408 [buganizer] Migrate DIR_METADATA in content/browser/
Migrate all metadata files for content/browser.

Verify components with http://b/components/{id} or at
go/chrome-on-buganizer-prod-components.

Bug: chromium:1518875
Change-Id: I555b9fe40952a5707e167b3dcbaf2858bbdf1f34
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5284095
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1258966}
2024-02-11 19:24:26 +00:00
Jan Lanik
819b603721 Returning an incorrectly removed call on iOS
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}
2024-01-12 12:58:26 +00:00
Arthur Sonzogni
c686e8f4fd Rename {absl => std}::optional in //content/
Automated patch, intended to be effectively a no-op.

Context:
https://groups.google.com/a/chromium.org/g/cxx/c/nBD_1LaanTc/m/ghh-ZZhWAwAJ?utm_medium=email&utm_source=footer

As of https://crrev.com/1204351, absl::optional is now a type alias for
std::optional. We should migrate toward it.

Script:
```
function replace {
  echo "Replacing $1 by $2"
  git grep -l "$1" \
    | cut -f1 -d: \
    | grep \
      -e "^content" \
    | sort \
    | uniq \
    | grep \
      -e "\.h" \
      -e "\.cc" \
      -e "\.mm" \
      -e "\.py" \
    | xargs sed -i "s/$1/$2/g"
}
replace "absl::make_optional" "std::make_optional"
replace "absl::optional" "std::optional"
replace "absl::nullopt" "std::nullopt"
replace "absl::in_place" "std::in_place"
replace "absl::in_place_t" "std::in_place_t"
replace "\"third_party\/abseil-cpp\/absl\/types\/optional.h\"" "<optional>"
git cl format
```

# Skipping unrelated "check_network_annotation" errors.
NOTRY=True

Bug: chromium:1500249
Change-Id: Icfd31a71d8faf63a2e8d5401127e7ee74cc1c413
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5185537
Auto-Submit: Arthur Sonzogni <arthursonzogni@chromium.org>
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Owners-Override: Avi Drissman <avi@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1245739}
2024-01-11 08:36:37 +00:00
Jan Lanik
0972b9cb73 Do not trigger OS notifications from browser
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}
2024-01-08 22:27:42 +00:00
Balazs Engedy
33b441e83b Improve wording of SubscribePermissionStatusChange.
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}
2023-12-12 18:53:42 +00:00
Florian Jacky
80e35304aa 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: 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}
2023-09-15 16:40:42 +00:00
Takumi Fujimoto
66a5e3008a [Code Health] Remove the dangling raw_ptr in GeolocationServiceTest
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}
2023-09-14 22:58:31 +00:00
Andy Paicu
0a6d4b5069 [PEPC] Add new structs to contain permission request data
This CL adds new struct PermissionRequestDescription and
PermissionRequestData that groups all information we will need to make
a permission request to permission infrastructure.
This is one in a series of CLs implementing the design:
https://docs.google.com/document/d/1a1gjlJ4VkAWoG8AeGKZDcQXm_c0q-cFTs_5MxmjWVYI/edit, next step is to parse the fields within the structs handle permission request from <permission> element properly.

Bug: 1271543,1462930
Change-Id: I4a7b64149bc3323075f802f832766aa2211455fc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4756727
Commit-Queue: Andy Paicu <andypaicu@chromium.org>
Reviewed-by: Peter Beverloo <peter@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Kamila Hasanbega <hkamila@chromium.org>
Reviewed-by: Yuchen Liu <yucliu@chromium.org>
Reviewed-by: Sergey Ulanov <sergeyu@chromium.org>
Reviewed-by: Florent Castelli <orphis@chromium.org>
Reviewed-by: Eric Seckler <eseckler@chromium.org>
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1189522}
2023-08-29 15:13:09 +00:00
Matt Reynolds
0c86babdc1 Revert "Stop geolocation watch updates upon permission revocation"
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}
2023-08-24 22:21:56 +00:00
Florian Jacky
d02d575ab5 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}
2023-07-31 18:35:51 +00:00
Jan Lanik
2fbc906121 [Privacy Hub] Passing the app id to system
Passing the app id to the system when a geolocation activity is
reported.

BUG=b:277718648
Change-Id: I170fe1fe65f411b27c6c01140856d38bd98ac384

Change-Id: I7679e56d9f72e50dbde87dc8177e88fc83d21f29
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4543082
Reviewed-by: Alexander Alekseev <alemate@chromium.org>
Auto-Submit: Jan Láník <janlanik@google.com>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Reviewed-by: Alex Newcomer <newcomer@chromium.org>
Commit-Queue: Jan Láník <janlanik@google.com>
Reviewed-by: Matt Reynolds <mattreynolds@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1156771}
2023-06-13 07:35:27 +00:00
Ari Chivukula
59515e0880 [Permissions Policy] Use Parse() for all OriginWithPossibleWildcard constructors
We were using a different origin based path for constructing some
allowlist entries, but we should consolidate here so that two paths
don't need to be maintained. This changes the return type so some
production code now has to branch to check an optional.

Bug: 1418009
Change-Id: I1fade263813fb2c2e2df0687ca1e3dd8e371eb6b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4574025
Code-Coverage: Findit <findit-for-me@appspot.gserviceaccount.com>
Reviewed-by: Colin Blundell <blundell@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Colin Blundell <blundell@chromium.org>
Auto-Submit: Ari Chivukula <arichiv@chromium.org>
Reviewed-by: Yoav Weiss <yoavweiss@chromium.org>
Reviewed-by: Ian Clelland <iclelland@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1152452}
2023-06-02 11:26:51 +00:00
Arthur Sonzogni
e98d214c48 DanglingPointer: annotate for unittests base+linux [1/N]
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}
2023-06-01 15:02:25 +00:00
Ari Chivukula
30c4e9115c [Permissions Policy] Refactor OriginWithPossibleWildcards
*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}
2023-05-25 12:35:50 +00:00
Jan Lanik
67c506b747 [Privacy Hub] Use GeolocationService
Geolocation privacy switch notifications are now triggered from the
GeolocationService, instead of being bound to the omnibox icon.

Bug: b:277718648
Change-Id: I3513c050d8c84b5e9973ca0f98d4b9dcc830e1eb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4521495
Commit-Queue: Jan Láník <janlanik@google.com>
Reviewed-by: Matt Reynolds <mattreynolds@chromium.org>
Reviewed-by: Balazs Engedy <engedy@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1147107}
2023-05-22 09:19:22 +00:00
Matt Reynolds
5e784e9d74 geolocation: Introduce mojom::GeopositionResult
This CL adds a new mojom::GeopositionResult type to replace existing
uses of mojom::Geoposition that can either contain a position estimate
or an error.

The new type uses a Mojo union so the position and error cases are
mutually exclusive.

Bug: 1409316
Change-Id: Ib0c5d5833d8bed9c50f074ba931755823be79fff
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4262527
Reviewed-by: Alvin Ji <alvinji@chromium.org>
Reviewed-by: Will Harris <wfh@chromium.org>
Reviewed-by: Daniel Murphy <dmurph@chromium.org>
Reviewed-by: Anthony Cui <cuianthony@chromium.org>
Commit-Queue: Matt Reynolds <mattreynolds@chromium.org>
Code-Coverage: Findit <findit-for-me@appspot.gserviceaccount.com>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Reviewed-by: Matthias Körber <koerber@google.com>
Reviewed-by: Andrey Kosyakov <caseq@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1133537}
2023-04-21 01:40:27 +00:00
Ari Chivukula
04f6ff7e5c [Permissions Policy + CSP] (1) Ban opaque origins from OriginWithPossibleWildcard
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}
2023-03-22 18:02:00 +00:00
Avi Drissman
adac219925 Update header includes for /base/functional in /content
bind.h, callback.h, callback_forward.h, and callback_helpers.h
moved into /base/functional/. Update the include paths to
directly include them in their new location.

Bug: 1364441
Change-Id: I32ec425b9c0e52ec4b50047bf3290fecc5c905ff
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4148554
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Auto-Submit: Avi Drissman <avi@chromium.org>
Owners-Override: Avi Drissman <avi@chromium.org>
Owners-Override: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1091567}
2023-01-11 23:46:39 +00:00
Sean Maher
e672a665ff task posting v3: remove includes of runner handles and IWYU task runners
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}
2023-01-09 21:42:28 +00:00
Sean Maher
5b9af51fdd task posting v3: moving away from ThreadTaskRunnerHandle
To continue the migration away from TaskRunnerHandles, the codebase
was refactored using the following scripts:
shell script:
https://paste.googleplex.com/4673967729147904
python:
https://paste.googleplex.com/5824001174667264

This will do a few sed-like modifications, changing calls to methods of
ThreadTaskRunnerHandle to calls to methods of
SingleThreadTaskRunner::CurrentDefaultHandle, and swapping includes.

Bug: 1026641
AX-Relnotes: n/a.
Change-Id: Ia33b6dfebb15937481c619f5c838720ce7bb2676
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4031817
Commit-Queue: Gabriel Charette <gab@chromium.org>
Reviewed-by: Gabriel Charette <gab@chromium.org>
Owners-Override: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1074085}
2022-11-21 15:32:47 +00:00
Ari Chivukula
aa0c119677 [Permissions Policy Wildcards] (2) Use OriginWithPossibleWildcards in policy
This CL just propagates OriginWithPossibleWildcards up and down the
stack. In all cases, the wildcard bool will be set to false as only the
next CL will start parsing cases where wildcards are on.
Design doc:
https://github.com/w3c/webappsec-permissions-policy/pull/482/

This CL is part of a series:
(1) Add function to detect subdomain matches
(2) Use OriginWithPossibleWildcards in policy
(3) Parse wildcard subdomain matches in policy
(4) Add WPTs

Bug: 1345994
Change-Id: Id38e069b434193ad3b2e77ec94ccc692a7db31fe
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3913410
Reviewed-by: Christoph Schwering <schwering@google.com>
Auto-Submit: Ari Chivukula <arichiv@chromium.org>
Reviewed-by: Bo Liu <boliu@chromium.org>
Reviewed-by: Dominick Ng <dominickn@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Yao Xiao <yaoxia@chromium.org>
Commit-Queue: Ari Chivukula <arichiv@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1052570}
2022-09-28 19:19:47 +00:00
Avi Drissman
4e1b7bc33d Update copyright headers in content/
The methodology used to generate this CL is documented in
https://crbug.com/1098010#c34.

No-Try: true
No-Presubmit: true
Bug: 1098010
Change-Id: I8c0f009d16350271f07d8e5e561085822cc9dd27
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3895935
Owners-Override: Avi Drissman <avi@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Mark Mentovai <mark@chromium.org>
Auto-Submit: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1047456}
2022-09-15 14:03:50 +00:00
Ella Ge
a4791e43d1 Makes TWA permission delegation use page url to find the TWA app
Let TWA notifications permission and location permission use the current
page url to find the delegated app. Location data also used the page
URL. Sending Notifications are unchanged.

Bug: 1357825

Change-Id: If294f8c1fe0bfbd1dead6169f7974b524f13ee51
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3855661
Reviewed-by: Peter Conn <peconn@chromium.org>
Reviewed-by: Matt Reynolds <mattreynolds@chromium.org>
Reviewed-by: Dominick Ng <dominickn@chromium.org>
Commit-Queue: Ella Ge <eirage@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1041934}
2022-09-01 06:14:31 +00:00
Illia Klimov
27239edc5a The permissions API code cleanup.
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}
2022-05-11 17:14:59 +00:00
Andy Paicu
a6d6d85580 Remove content::PermissionType references and replace them with...
...blink::PermissionType

This is a follow-up of https://chromium-review.googlesource.com/c/chromium/src/+/3359620
which moved PermissionType to blink but left a `using` statement to
avoid modifying a large amount of files in an already complicated
enough CL.

This CL removes that statement and modifies all references to use the
blink type.

Bug: 1122423
Change-Id: Ia2e992d1cb1456bbba72c4d9ee38b74fca8cab1e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3593199
Commit-Queue: Andy Paicu <andypaicu@chromium.org>
Reviewed-by: Clark DuVall <cduvall@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Illia Klimov <elklm@chromium.org>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Reviewed-by: Eugene Zemtsov <eugene@chromium.org>
Reviewed-by: Joshua Bell <jsbell@chromium.org>
Reviewed-by: Eric Seckler <eseckler@chromium.org>
Reviewed-by: Peter Beverloo <peter@chromium.org>
Reviewed-by: Ted Choc <tedchoc@chromium.org>
Reviewed-by: Sean Topping <seantopping@chromium.org>
Reviewed-by: Daseul Lee <dslee@chromium.org>
Reviewed-by: Kevin Marshall <kmarshall@chromium.org>
Reviewed-by: Andrey Kosyakov <caseq@chromium.org>
Reviewed-by: Alexander Timin <altimin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#997288}
2022-04-28 18:08:36 +00:00
Illia Klimov
a181b7dda5 Add new API into PermissionController.
This CL adds the following APIs:
1. `RequestPermission()`
2. `RequestPermissionFromCurrentDocument()`

More details here:
go/permission-controller
go/permission-manager-hardening

Bug: 1271543
Change-Id: I80f1ae00aa1ef0afabd00999a89bd58397a5d678
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3498341
Reviewed-by: Andy Paicu <andypaicu@chromium.org>
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: Victor Costan <pwnall@chromium.org>
Commit-Queue: Illia Klimov <elklm@google.com>
Cr-Commit-Position: refs/heads/main@{#981014}
2022-03-15 08:17:47 +00:00
Keishi Hattori
0e45c020c4 Rewrite most Foo* field_ pointer fields to raw_ptr<Foo> field_.
DO NOT REVERT (unless absolutely necessary)! Report build breaks to keishi@(APAC)/glazunov@(EMEA)/sebmarchand@(NA) as soon as you see them. Fixes are expected to be trivial.

This commit was generated automatically, by running the following script: tools/clang/rewrite_raw_ptr_fields/rewrite-multiple-platforms.sh on commit fe74bc434e

For more information, see MiraclePtr One Pager [1], the PSA at chromium-dev@ [2], and the raw_ptr documentation in //base/memory/raw_ptr.md.

FYI This CL does not enable MiraclePtr protection and we expect no behavior change from this.

[1] https://docs.google.com/document/d/1pnnOAIz_DMWDI4oIOFoMAqLnf_MZ2GsrJNb_dbQ3ZBg/edit?usp=sharing
[2] https://groups.google.com/a/chromium.org/g/chromium-dev/c/vAEeVifyf78/m/SkBUc6PhBAAJ

Binary-Size: Increase of around 500kb was approved for MiraclePtr
Include-Ci-Only-Tests: true
No-Tree-Checks: true
No-Presubmit: true
Bug: 1272324, 1073933
Change-Id: I05c86a83bbb4b3f4b017f361dd7f4e7437697f69
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3305132
Commit-Queue: Keishi Hattori <keishi@chromium.org>
Reviewed-by: Bartek Nowierski <bartekn@chromium.org>
Owners-Override: Bartek Nowierski <bartekn@chromium.org>
Cr-Commit-Position: refs/heads/main@{#945735}
2021-11-27 09:25:52 +00:00
Reilly Grant
a6c2daf727 Unify owners for geolocation-related code
This change creates //content/browser/geolocation/OWNERS as the single
source of truth for code owners for the geolocation feature.

Change-Id: If8689516b08405bfd3b4a722b5bea2d54e083939
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3290601
Auto-Submit: Reilly Grant <reillyg@chromium.org>
Reviewed-by: Matt Reynolds <mattreynolds@chromium.org>
Reviewed-by: Ben Wells <benwells@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Ted Choc <tedchoc@chromium.org>
Commit-Queue: Reilly Grant <reillyg@chromium.org>
Cr-Commit-Position: refs/heads/main@{#943131}
2021-11-18 17:08:06 +00:00
Peter Boström
9b036533b6 Remove DISALLOW_* macros from content/
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}
2021-10-28 23:37:28 +00:00
Peter Boström
828b902994 Replace DISALLOW_COPY_AND_ASSIGN in content/
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}
2021-09-21 02:28:43 +00:00
Yeunjoo Choi
2e9cad031f [mparch] GeolocationServiceImpl should grab origin from RenderFrameHost
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}
2021-07-21 01:12:59 +00:00
Lukasz Anforowicz
820611542b Real instance methods for BrowserContext: permission controller methods.
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}
2021-05-14 02:14:26 +00:00
Lei Zhang
51b71c2d8e Remove empty OWNERS files.
Likely many of these are empty as a result of the DIR_METADATA
migration. Since they serve no purpose, remove them.

Bug: 1113033
Change-Id: I11dba67c11dd722aeb7acf9ca1bfbcc48120ceaf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2806701
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Owners-Override: Lei Zhang <thestig@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#871728}
2021-04-13 01:06:45 +00:00
Peter Boström
dd7e40ec31 Apply modernize-make-unique to content/
This is a large-scale change: go/chromium-modernize-make-unique

Bug: 1194272
Change-Id: Id035e6a5058ab109a4333f1b8f8225da1c6989e4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2803034
Commit-Queue: 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/master@{#869261}
2021-04-05 20:40:10 +00:00
Balazs Engedy
e30e96165f Remove unused PermissionRequest IDs.
The PermissionControllerDelegate returns IDs for RequestPermission and
RequestPermissions calls, but these IDs are not used for anything and
just create bookkeeping overhead. Remove them.

Bug: 1194491
Change-Id: I94e0145fd0a3b1c4119f0f8bef3450f2bc334e45
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2795107
Reviewed-by: Richard Coles <torne@chromium.org>
Reviewed-by: Andrey Kosyakov <caseq@chromium.org>
Reviewed-by: Sergey Volk <servolk@chromium.org>
Reviewed-by: Fabrice de Gans-Riberi <fdegans@chromium.org>
Reviewed-by: Olivier Yiptong <oyiptong@chromium.org>
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: Andy Paicu <andypaicu@chromium.org>
Commit-Queue: Balazs Engedy <engedy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#868857}
2021-04-02 10:37:29 +00:00
WangHui
4dafed92a3 Introduce the PermissionCallback to make a bit less verbose.
No logic changed.

Bug:None

Change-Id: Ia4dd9824e0272a4cadf21de9527f1ad2cf9fc710
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2735434
Reviewed-by: Bo <boliu@chromium.org>
Commit-Queue: HuiWang <wanghui210@huawei.com>
Cr-Commit-Position: refs/heads/master@{#860960}
2021-03-09 01:02:17 +00:00
Charlie Hu
e20fe2f18e [Permissions Policy] Rename 'feature_policy' in variables
Bug: 1123116
Change-Id: Id93a94045f7b26a2bcdd9268603c112c8cfb950d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2727596
Commit-Queue: Charlie Hu <chenleihu@google.com>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Ian Clelland <iclelland@chromium.org>
Owners-Override: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#860572}
2021-03-07 03:39:59 +00:00
Charlie Hu
e24f0483a2 [Permissions Policy] Rename blink::ParsedFeaturePolicy
This CL renames:
blink::ParsedFeaturePolicy => blink::ParsedPermissionsPolicy
blink::ParsedFeaturePolicyDeclaration =>
blink::ParsedPermissionsPolicyDeclaration

Bug: 1123116
Change-Id: I561937e3ecc50d7f5592219268d9936dd0d72377
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2713504
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Ian Clelland <iclelland@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Owners-Override: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#859934}
2021-03-04 21:07:06 +00:00
Charlie Hu
1b9da2c5b4 [Permissions Policy] Rename FeaturePolicyFeature terms
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}
2021-03-04 18:51:30 +00:00
Charlie Hu
e010cf2a55 [Permissions Policy] Rename 'feature_policy' in file names
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}
2021-03-03 23:09:51 +00:00
Josip Sokcevic
32c10f4d66 [2/N] Add DIR_METADATA files to directories under //content
Generate DIR_METADATA files and remove metadata from OWNERS
files for directories under //content.

R=boliu@chromium.org

Bug: 1113033
Change-Id: I409968b2318bd07214affd931c3db1b07431403a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2544853
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
Reviewed-by: Bo <boliu@chromium.org>
Auto-Submit: Josip Sokcevic <sokcevic@google.com>
Cr-Commit-Position: refs/heads/master@{#828511}
2020-11-18 00:56:22 +00:00
danakj
db9ae7941a Rename includes from bind_helpers.h to callback_helpers.h
R=dcheng@chromium.org
NOPRESUBMIT=true
TBR=
NOTRY=true

Change-Id: I93bc6a9360997fae7adeab8c01f56e08fc025dd2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2523543
Commit-Queue: danakj <danakj@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Cr-Commit-Position: refs/heads/master@{#826289}
2020-11-11 16:01:35 +00:00
Ian Clelland
156a520e6e Use allow attribute for permission delegation tests.
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}
2020-09-30 17:48:21 +00:00
Ella Ge
3e375b7000 [LocationDelegation] Delegate location data from TWA
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}
2020-06-05 15:57:16 +00:00