Skip to content

Commit

Permalink
Set runtime feature field of blink::Impression for context menu
Browse files Browse the repository at this point in the history
controller

Bug: 1450863
Change-Id: I4be27de2bc72202fbccd7cb73c43f8781f3b1d5f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4582329
Reviewed-by: Andrew Paseltiner <apaseltiner@chromium.org>
Commit-Queue: Nan Lin <linnan@chromium.org>
Reviewed-by: David Bokan <bokan@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1152532}
  • Loading branch information
linnan-github authored and Chromium LUCI CQ committed Jun 2, 2023
1 parent cf0dfd9 commit 827466e
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions third_party/blink/renderer/core/page/context_menu_controller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -755,12 +755,17 @@ bool ContextMenuController::ShowContextMenu(LocalFrame* frame,

// An impression should be attached to the navigation regardless of
// whether a background request would have been allowed or attempted.
if (!data.impression &&
selected_frame->GetAttributionSrcLoader()->CanRegister(
result.AbsoluteLinkURL(), /*element=*/anchor,
/*request_id=*/absl::nullopt)) {
data.impression = blink::Impression{
.nav_type = mojom::blink::AttributionNavigationType::kContextMenu};
if (!data.impression) {
if (AttributionSrcLoader* attribution_src_loader =
selected_frame->GetAttributionSrcLoader();
attribution_src_loader->CanRegister(result.AbsoluteLinkURL(),
/*element=*/anchor,
/*request_id=*/absl::nullopt)) {
data.impression = blink::Impression{
.nav_type = mojom::blink::AttributionNavigationType::kContextMenu,
.runtime_features = attribution_src_loader->GetRuntimeFeatures(),
};
}
}
}
}
Expand Down

0 comments on commit 827466e

Please sign in to comment.