[cr149] Using SetHighlightedElement
This change migrates from `SetHighlightedButton` to `SetHighlightedElement`, which expects an element id. Chromium changes: https://chromium.googlesource.com/chromium/src/+/b382a3d424be203195b983b3d37b258786c839f8 https://chromium.googlesource.com/chromium/src/+/5c61647fa6331ad61b0173fb2780e3ce732445dd commit b382a3d424be203195b983b3d37b258786c839f8 Author: Maks Orlovich <morlovich@chromium.org> Date: Fri Apr 24 11:59:39 2026 -0700 Finish SetHighlightedButton->Element migration. The final user (the CrOS input overlay for games) was working around a bug in SetAnchorView not updating the highlight unless it also changed the widget (or was being set for the first time). So testcase + fix that bug, and remove the now unneeded call. With that done, the now unused SetHighlightedButton and corresponding code are also removed, as is some of the necessary state. The ability to highlight views::Buttons is still around, however, since they may be the anchor. Bug: 489349570 Change-Id: I48f49ce05f07379db8dbf3b6614b85a66a2b165a Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7789255 Reviewed-by: Dana Fried <dfried@chromium.org> Commit-Queue: Maks Orlovich <morlovich@chromium.org> Reviewed-by: Cici Ruan <cuicuiruan@google.com> Cr-Commit-Position: refs/heads/main@{#1620373} commit 5c61647fa6331ad61b0173fb2780e3ce732445dd Author: Maks Orlovich <morlovich@chromium.org> Date: Tue Mar 10 15:57:49 2026 -0700 Migrate ContentSettingsImageView to SetHighlightedElement. This required giving all of them an ElementIdentifier, which we will need for the WebUI impl anyway. To support multiple implementations the naming was placed in the Model, and the view made to use it consistently. Loosely inspired by caraitto@'s https://chromium-review.googlesource.com/c/chromium/src/+/7591203 Bug: 489349570 Change-Id: I6993f6acd2edd1d20a12ec951a4a2e2dfee4a625 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7649608 Reviewed-by: Andy Paicu <andypaicu@chromium.org> Reviewed-by: Kaan Alsan <alsan@chromium.org> Commit-Queue: Maks Orlovich <morlovich@chromium.org> Cr-Commit-Position: refs/heads/main@{#1597382}
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
#include "base/check_deref.h"
|
||||
#include "base/task/sequenced_task_runner.h"
|
||||
#include "brave/browser/ui/views/page_info/brave_page_info_bubble_view.h"
|
||||
#include "chrome/browser/ui/browser_element_identifiers.h"
|
||||
#include "chrome/browser/ui/user_education/browser_user_education_interface.h"
|
||||
#include "chrome/browser/ui/views/location_bar/location_icon_view.h"
|
||||
#include "chrome/browser/ui/views/page_info/page_info_bubble_specification.h"
|
||||
@@ -131,7 +132,7 @@ void BraveShieldsPageInfoController::ShowBubbleForRepeatedReloads() {
|
||||
|
||||
auto* page_info_bubble = views::AsViewClass<BravePageInfoBubbleView>(bubble);
|
||||
CHECK(page_info_bubble);
|
||||
page_info_bubble->SetHighlightedButton(&location_icon_view_.get());
|
||||
page_info_bubble->SetHighlightedElement(kLocationIconElementId);
|
||||
page_info_bubble->GetWidget()->Show();
|
||||
page_info_bubble->OpenShieldsPageAfterRepeatedReloads();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user