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

(cherry picked from commit 827466e)

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-Original-Commit-Position: refs/heads/main@{#1152532}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4591569
Cr-Commit-Position: refs/branch-heads/5790@{#370}
Cr-Branched-From: 1d71a33-refs/heads/main@{#1148114}
  • Loading branch information
linnan-github authored and Chromium LUCI CQ committed Jun 5, 2023
1 parent 3fbf4e8 commit 1d26363
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
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 1d26363

Please sign in to comment.