[omnibox] Add new animation for Ai Mode button in Omnibox [chromium/src : main]

0 views
Skip to first unread message

Aviv Kiss (Gerrit)

unread,
12:19 PM (11 hours ago) 12:19 PM
to Caitlin Chen, Kaan Alsan, Chromium LUCI CQ, chromium...@chromium.org, jdonnel...@chromium.org, omnibox-...@chromium.org
Attention needed from Caitlin Chen and Kaan Alsan

Aviv Kiss voted and added 4 comments

Votes added by Aviv Kiss

Code-Review+1

4 comments

File chrome/browser/ui/views/location_bar/icon_label_bubble_view.cc
Line 564, Patchset 16 (Latest): }
Aviv Kiss . unresolved

Please fix this WARNING reported by autoreview issue finding: This looks like it is missing the `InkDrop` updates and `host->UpdateBackground()` that `StandardIconLabelBubbleAnimation::OnAnimationEnded` has.

Since `ShowAnimation()` and `HideAnimation()` in `IconLabelBubbleView` set `ShowHighlightOnHover` and `ShowHighlightOnFocus` to `false`, failing to restore them here will result in the AI Mode button permanently losing its hover and focus highlights after an animation ends.

Consider adding:
```cpp
views::InkDrop::Get(host)->GetInkDrop()->SetShowHighlightOnHover(true);
views::InkDrop::Get(host)->GetInkDrop()->SetShowHighlightOnFocus(
!views::FocusRing::Get(host));
host->UpdateBackground();
```
Line 897, Patchset 16 (Latest): CHECK(animation_);
Aviv Kiss . unresolved

I think these CHECK calls will result in crashes in production. Is that intended?

File chrome/browser/ui/views/page_action/page_action_view.cc
Line 178, Patchset 16 (Latest): UpdateIconImage();
Aviv Kiss . unresolved

Please fix this WARNING reported by autoreview issue finding: `UpdateIconImage()` is already called at the end of `UpdateAnimationState()` which is executed below on line 189. We can remove this call to avoid doing the same work twice.

Line 213, Patchset 16 (Latest): // Drive transitions generically
Aviv Kiss . unresolved

What does this mean in this context? Looks like the actual code block below this is reseting if not visible?

Open in Gerrit

Related details

Attention is currently required from:
  • Caitlin Chen
  • Kaan Alsan
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement 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: I4f60f4f2045ce3ed59080593b16e30e3d2a66b3e
Gerrit-Change-Number: 7965783
Gerrit-PatchSet: 16
Gerrit-Owner: Caitlin Chen <ca...@google.com>
Gerrit-Reviewer: Aviv Kiss <aviv...@google.com>
Gerrit-Reviewer: Caitlin Chen <ca...@google.com>
Gerrit-Reviewer: Kaan Alsan <al...@chromium.org>
Gerrit-Attention: Caitlin Chen <ca...@google.com>
Gerrit-Attention: Kaan Alsan <al...@chromium.org>
Gerrit-Comment-Date: Wed, 24 Jun 2026 16:18:51 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Caitlin Chen (Gerrit)

unread,
1:31 PM (10 hours ago) 1:31 PM
to Aviv Kiss, Kaan Alsan, Chromium LUCI CQ, chromium...@chromium.org, jdonnel...@chromium.org, omnibox-...@chromium.org

Caitlin Chen added 4 comments

File chrome/browser/ui/views/location_bar/icon_label_bubble_view.cc
Line 564, Patchset 16: }
Aviv Kiss . resolved

Please fix this WARNING reported by autoreview issue finding: This looks like it is missing the `InkDrop` updates and `host->UpdateBackground()` that `StandardIconLabelBubbleAnimation::OnAnimationEnded` has.

Since `ShowAnimation()` and `HideAnimation()` in `IconLabelBubbleView` set `ShowHighlightOnHover` and `ShowHighlightOnFocus` to `false`, failing to restore them here will result in the AI Mode button permanently losing its hover and focus highlights after an animation ends.

Consider adding:
```cpp
views::InkDrop::Get(host)->GetInkDrop()->SetShowHighlightOnHover(true);
views::InkDrop::Get(host)->GetInkDrop()->SetShowHighlightOnFocus(
!views::FocusRing::Get(host));
host->UpdateBackground();
```
Caitlin Chen

Done

Line 897, Patchset 16: CHECK(animation_);
Aviv Kiss . resolved

I think these CHECK calls will result in crashes in production. Is that intended?

Caitlin Chen

Ah, yes I likely meant DCHECK. CHanged!

File chrome/browser/ui/views/page_action/page_action_view.cc
Line 178, Patchset 16: UpdateIconImage();
Aviv Kiss . resolved

Please fix this WARNING reported by autoreview issue finding: `UpdateIconImage()` is already called at the end of `UpdateAnimationState()` which is executed below on line 189. We can remove this call to avoid doing the same work twice.

Caitlin Chen

Done

Line 213, Patchset 16: // Drive transitions generically
Aviv Kiss . resolved

What does this mean in this context? Looks like the actual code block below this is reseting if not visible?

Caitlin Chen

Sorry that was a misplaced comment trying to describe the transitions were being handled by the animation.

Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement 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: I4f60f4f2045ce3ed59080593b16e30e3d2a66b3e
    Gerrit-Change-Number: 7965783
    Gerrit-PatchSet: 17
    Gerrit-Owner: Caitlin Chen <ca...@google.com>
    Gerrit-Reviewer: Aviv Kiss <aviv...@google.com>
    Gerrit-Reviewer: Caitlin Chen <ca...@google.com>
    Gerrit-Reviewer: Kaan Alsan <al...@chromium.org>
    Gerrit-Comment-Date: Wed, 24 Jun 2026 17:31:28 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Aviv Kiss <aviv...@google.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Kaan Alsan (Gerrit)

    unread,
    4:26 PM (7 hours ago) 4:26 PM
    to Caitlin Chen, Aviv Kiss, Chromium LUCI CQ, chromium...@chromium.org, jdonnel...@chromium.org, omnibox-...@chromium.org
    Attention needed from Caitlin Chen

    Kaan Alsan added 6 comments

    Patchset-level comments
    File-level comment, Patchset 17 (Latest):
    Kaan Alsan . resolved

    I haven't looked at icon_label_bubble_view implementation yet, will get to it tomorrow

    File chrome/browser/ui/page_action/page_action_controller.h
    Line 269, Patchset 17 (Latest):
    virtual void SetAnimationStyle(actions::ActionId action_id,
    PageActionAnimationStyle style) = 0;
    virtual void SetTrailingImage(actions::ActionId action_id,
    const ui::ImageModel& trailing_image) = 0;
    virtual void ClearTrailingImage(actions::ActionId action_id) = 0;
    virtual void SetShowTrailingIcon(actions::ActionId action_id, bool show) = 0;
    Kaan Alsan . unresolved

    Add comment documenting what these do.

    File chrome/browser/ui/page_action/page_action_enums.h
    Line 26, Patchset 17 (Latest):
    Kaan Alsan . unresolved

    nit: add documentation

    File chrome/browser/ui/views/location_bar/icon_label_bubble_view.cc
    Line 897, Patchset 16: CHECK(animation_);
    Aviv Kiss . unresolved

    I think these CHECK calls will result in crashes in production. Is that intended?

    Caitlin Chen

    Ah, yes I likely meant DCHECK. CHanged!

    Kaan Alsan

    We should be using CHECKs instead of DCHECKs, unless there's a good reason (usually performance related): https://chromium.googlesource.com/chromium/src/+/HEAD/styleguide/c++/checks.md#invariant_verification-mechanisms.

    If `animation_` really is null and we don't crash via CHECK, then the next line will be a null deref, which will still crash _and_ be a security issue.

    File chrome/browser/ui/views/page_action/page_action_view.h
    Line 134, Patchset 17 (Latest): IconLabelBubbleView::AnimationStyle GetAnimationStyleForTesting() const {
    return GetAnimationStyle();
    }
    views::ImageView* GetTrailingImageViewForTesting() const {
    return GetTrailingImageView();
    }
    Kaan Alsan . unresolved

    these aren't trivial implementations (i.e. directly returning a member), so shouldn't be defined inline.

    Line 137, Patchset 17 (Latest): views::ImageView* GetTrailingImageViewForTesting() const {
    Kaan Alsan . unresolved

    This method isn't const-correct. It should either return `const views::ImageView*` or this shouldn't be a `const` method. Same comment applies within icon_label_bubble_view.cc/h.

    https://chromium.googlesource.com/chromium/src/+/main/styleguide/c++/const.md

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Caitlin Chen
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      • requirement 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: I4f60f4f2045ce3ed59080593b16e30e3d2a66b3e
      Gerrit-Change-Number: 7965783
      Gerrit-PatchSet: 17
      Gerrit-Owner: Caitlin Chen <ca...@google.com>
      Gerrit-Reviewer: Aviv Kiss <aviv...@google.com>
      Gerrit-Reviewer: Caitlin Chen <ca...@google.com>
      Gerrit-Reviewer: Kaan Alsan <al...@chromium.org>
      Gerrit-Attention: Caitlin Chen <ca...@google.com>
      Gerrit-Comment-Date: Wed, 24 Jun 2026 20:26:33 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Caitlin Chen <ca...@google.com>
      Comment-In-Reply-To: Aviv Kiss <aviv...@google.com>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Caitlin Chen (Gerrit)

      unread,
      9:29 PM (2 hours ago) 9:29 PM
      to Aviv Kiss, Kaan Alsan, Chromium LUCI CQ, chromium...@chromium.org, jdonnel...@chromium.org, omnibox-...@chromium.org
      Attention needed from Kaan Alsan

      Caitlin Chen added 6 comments

      Patchset-level comments
      Kaan Alsan . resolved

      I haven't looked at icon_label_bubble_view implementation yet, will get to it tomorrow

      Caitlin Chen

      No worries!! Thanks for being patient with me and all the guidance!!

      File chrome/browser/ui/page_action/page_action_controller.h

      virtual void SetAnimationStyle(actions::ActionId action_id,
      PageActionAnimationStyle style) = 0;
      virtual void SetTrailingImage(actions::ActionId action_id,
      const ui::ImageModel& trailing_image) = 0;
      virtual void ClearTrailingImage(actions::ActionId action_id) = 0;
      virtual void SetShowTrailingIcon(actions::ActionId action_id, bool show) = 0;
      Kaan Alsan . resolved

      Add comment documenting what these do.

      Caitlin Chen

      Done

      File chrome/browser/ui/page_action/page_action_enums.h
      Line 26, Patchset 17:
      Kaan Alsan . resolved

      nit: add documentation

      Caitlin Chen

      Done

      File chrome/browser/ui/views/location_bar/icon_label_bubble_view.cc
      Line 897, Patchset 16: CHECK(animation_);
      Aviv Kiss . resolved

      I think these CHECK calls will result in crashes in production. Is that intended?

      Caitlin Chen

      Ah, yes I likely meant DCHECK. CHanged!

      Kaan Alsan

      We should be using CHECKs instead of DCHECKs, unless there's a good reason (usually performance related): https://chromium.googlesource.com/chromium/src/+/HEAD/styleguide/c++/checks.md#invariant_verification-mechanisms.

      If `animation_` really is null and we don't crash via CHECK, then the next line will be a null deref, which will still crash _and_ be a security issue.

      Caitlin Chen

      Done

      File chrome/browser/ui/views/page_action/page_action_view.h
      Line 134, Patchset 17: IconLabelBubbleView::AnimationStyle GetAnimationStyleForTesting() const {

      return GetAnimationStyle();
      }
      views::ImageView* GetTrailingImageViewForTesting() const {
      return GetTrailingImageView();
      }
      Kaan Alsan . resolved

      these aren't trivial implementations (i.e. directly returning a member), so shouldn't be defined inline.

      Caitlin Chen

      Done

      Line 137, Patchset 17: views::ImageView* GetTrailingImageViewForTesting() const {
      Kaan Alsan . resolved

      This method isn't const-correct. It should either return `const views::ImageView*` or this shouldn't be a `const` method. Same comment applies within icon_label_bubble_view.cc/h.

      https://chromium.googlesource.com/chromium/src/+/main/styleguide/c++/const.md

      Caitlin Chen

      Done

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Kaan Alsan
      Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement is not satisfiedCode-Owners
        • requirement satisfiedCode-Review
        • requirement 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: I4f60f4f2045ce3ed59080593b16e30e3d2a66b3e
        Gerrit-Change-Number: 7965783
        Gerrit-PatchSet: 18
        Gerrit-Owner: Caitlin Chen <ca...@google.com>
        Gerrit-Reviewer: Aviv Kiss <aviv...@google.com>
        Gerrit-Reviewer: Caitlin Chen <ca...@google.com>
        Gerrit-Reviewer: Kaan Alsan <al...@chromium.org>
        Gerrit-Attention: Kaan Alsan <al...@chromium.org>
        Gerrit-Comment-Date: Thu, 25 Jun 2026 01:28:37 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        Comment-In-Reply-To: Caitlin Chen <ca...@google.com>
        Comment-In-Reply-To: Aviv Kiss <aviv...@google.com>
        Comment-In-Reply-To: Kaan Alsan <al...@chromium.org>
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy
        Reply all
        Reply to author
        Forward
        0 new messages