[cr147] PageActionModel::NotifyChange signature changed.

Chromium change:
https://source.chromium.org/chromium/chromium/src/+/2b7ab5aadfb26be57df25485c776474b16f16fce

commit 2b7ab5aadfb26be57df25485c776474b16f16fce
Author: Helmut Januschka <helmut@januschka.com>
Date:   Wed Feb 25 12:46:26 2026 -0800

    [PageActions] Defer reentrant model notifications in PageActionModel

    Replace the CHECK in NotifyChange with a deferred-notification loop so
    that reentrant calls are coalesced instead of crashing.

    Bug: 486080128
This commit is contained in:
Max Karolinskiy
2026-03-26 19:25:26 -04:00
parent 46e604c31f
commit 4f99b7a6ae
3 changed files with 24 additions and 6 deletions
@@ -13,7 +13,7 @@ void PageActionModel::SetAlwaysShowLabel(base::PassKey<PageActionController>,
return;
}
always_show_label_ = always_show;
NotifyChange();
NotifyChange(Property::kAlwaysShowLabel);
}
bool PageActionModel::GetAlwaysShowLabel() const {
@@ -30,7 +30,7 @@ void PageActionModel::SetOverrideChipColors(
}
override_background_color_ = override_background_color;
override_foreground_color_ = override_foreground_color;
NotifyChange();
NotifyChange(Property::kOverrideChipColors);
}
std::optional<SkColor> PageActionModel::GetOverrideBackgroundColor() const {
@@ -47,7 +47,7 @@ void PageActionModel::SetOverrideHeight(base::PassKey<PageActionController>,
return;
}
override_height_ = height;
NotifyChange();
NotifyChange(Property::kOverrideHeight);
}
std::optional<int> PageActionModel::GetOverrideHeight() const {
@@ -1,8 +1,8 @@
diff --git a/chrome/browser/ui/views/page_action/page_action_model.h b/chrome/browser/ui/views/page_action/page_action_model.h
index d78b31798b488fdde784361dce940287253dbd3d..f10a4717a193212456e019a9562fd61a26fa82bb 100644
index a3d1abf58e71b25edb1487e2cf92c5587539d85b..daffa064f8e97b9ba1e6f0100dfd70cd1a491c28 100644
--- a/chrome/browser/ui/views/page_action/page_action_model.h
+++ b/chrome/browser/ui/views/page_action/page_action_model.h
@@ -32,6 +32,19 @@ class PageActionModelInterface {
@@ -33,6 +33,19 @@ class PageActionModelInterface {
public:
PageActionModelInterface() = default;
virtual ~PageActionModelInterface() = default;
@@ -22,7 +22,7 @@ index d78b31798b488fdde784361dce940287253dbd3d..f10a4717a193212456e019a9562fd61a
virtual void AddObserver(PageActionModelObserver* observer) = 0;
virtual void RemoveObserver(PageActionModelObserver* observer) = 0;
@@ -97,6 +110,27 @@ class PageActionModel : public PageActionModelInterface {
@@ -120,6 +133,27 @@ class PageActionModel : public PageActionModelInterface {
PageActionModel& operator=(const PageActionModel&) = delete;
~PageActionModel() override;
@@ -50,3 +50,13 @@ index d78b31798b488fdde784361dce940287253dbd3d..f10a4717a193212456e019a9562fd61a
void AddObserver(PageActionModelObserver* observer) override;
void RemoveObserver(PageActionModelObserver* observer) override;
@@ -210,6 +244,9 @@ class PageActionModel : public PageActionModelInterface {
// per-property reentrancy checks.
enum class Property {
kShowRequested,
+ kAlwaysShowLabel,
+ kOverrideChipColors,
+ kOverrideHeight,
kShouldShowSuggestionChip,
kSuggestionChipConfig,
kTabActive,
@@ -46,3 +46,11 @@ replace = '''\1
std::optional<int> override_height_;
public:'''
[[substitution]]
description = 'Adding Property types for NotifyChange for the 2 set methods added above'
re_pattern = '(\s+kShowRequested,)'
replace = '''\1
kAlwaysShowLabel,
kOverrideChipColors,
kOverrideHeight,'''