[Search] Observe TemplateURLService from search engines handler [chromium/src : main]

0 views
Skip to first unread message

Amelie Schneider (Gerrit)

unread,
11:23 AM (2 hours ago) 11:23 AM
to Nicolas Dossou-Gbété, Chromium LUCI CQ, chromium...@chromium.org
Attention needed from Nicolas Dossou-Gbété

Amelie Schneider voted and added 1 comment

Votes added by Amelie Schneider

Commit-Queue+0

1 comment

Patchset-level comments
File-level comment, Patchset 4 (Latest):
Amelie Schneider . resolved

Hi Nicolas, could you please take a look? Thanks!

Open in Gerrit

Related details

Attention is currently required from:
  • Nicolas Dossou-Gbété
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Iac36064cde86f3470530c9fe26f34d94c62e97e3
Gerrit-Change-Number: 7696763
Gerrit-PatchSet: 4
Gerrit-Owner: Amelie Schneider <ame...@google.com>
Gerrit-Reviewer: Amelie Schneider <ame...@google.com>
Gerrit-Reviewer: Nicolas Dossou-Gbété <d...@chromium.org>
Gerrit-Attention: Nicolas Dossou-Gbété <d...@chromium.org>
Gerrit-Comment-Date: Tue, 24 Mar 2026 15:23:12 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Nicolas Dossou-Gbété (Gerrit)

unread,
12:48 PM (11 minutes ago) 12:48 PM
to Amelie Schneider, Chromium LUCI CQ, chromium...@chromium.org
Attention needed from Amelie Schneider

Nicolas Dossou-Gbété added 4 comments

File chrome/browser/ui/webui/settings/search_engines_handler.h
Line 114, Patchset 4 (Latest): base::WeakPtrFactory<SearchEnginesHandler> weak_ptr_factory_{this};
Nicolas Dossou-Gbété . unresolved

unused? we should remove it

Line 35, Patchset 4 (Latest): // TemplateURLServiceObserver notification.
Nicolas Dossou-Gbété . unresolved

nit: convention for grouping overridden methods

```suggestion
// TemplateURLServiceObserver implementation.
```
File chrome/browser/ui/webui/settings/search_engines_handler.cc
Line 105, Patchset 4 (Latest): pref_change_registrar_.Init(profile_->GetPrefs());
Nicolas Dossou-Gbété . unresolved

looks unused, we should be able to remove it

Line 172, Patchset 4 (Parent): list_controller_.table_model()->SetObserver(nullptr);
Nicolas Dossou-Gbété . unresolved

is this the right thing to do? Doesn't it mean that it could still be updating and firing events even if the handler is not supposed to be active? I see a lot of other settings handlers wiring up their observers in `OnJavascriptAllowed` and unregistering them in `OnJavascriptDisallowed`. I think we should follow that pattern. [WebUI docs](https://chromium.googlesource.com/chromium/src/+/HEAD/docs/webui/webui_explainer.md#webuimessagehandler_allowjavascript) also mention it.

IDK how relevant it is in modern WebUI, but If we want to diverge from it, we should check with dpapad@

In the meantime, since we have `profile_`, we should be able to rewire the observers easily

Open in Gerrit

Related details

Attention is currently required from:
  • Amelie Schneider
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Iac36064cde86f3470530c9fe26f34d94c62e97e3
    Gerrit-Change-Number: 7696763
    Gerrit-PatchSet: 4
    Gerrit-Owner: Amelie Schneider <ame...@google.com>
    Gerrit-Reviewer: Amelie Schneider <ame...@google.com>
    Gerrit-Reviewer: Nicolas Dossou-Gbété <d...@chromium.org>
    Gerrit-Attention: Amelie Schneider <ame...@google.com>
    Gerrit-Comment-Date: Tue, 24 Mar 2026 16:48:26 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy
    Reply all
    Reply to author
    Forward
    0 new messages