Vertical Tabs: Tab Search Button [chromium/src : main]

0 views
Skip to first unread message

Kunal Daftari (Gerrit)

unread,
Sep 23, 2025, 7:28:03 PM (2 days ago) Sep 23
to chromium...@chromium.org, roblia...@chromium.org, sky+...@chromium.org

Kunal Daftari added 4 comments

File chrome/browser/ui/views/frame/browser_view.h
Line 156, Patchset 6 (Latest): void SetTabSearchBubbleHost();
Kunal Daftari . unresolved

Location of function in file could be changed.

File chrome/browser/ui/views/tabs/vertical/vertical_tab_strip_top_button_container.cc
Line 50, Patchset 6 (Latest): gfx::Rect button_bounds(
Kunal Daftari . unresolved

For now this sizing seems to be working, but should be evaluated further to make sure it's correct.

Line 82, Patchset 6 (Latest):bool VerticalTabStripTopButtonContainer::IsPositionInWindowCaption(
Kunal Daftari . unresolved

This code was copied from tab_strip_region_view.cc. It does almost exactly the same thing except uses tab_search_button_ instead of new_tab_button_.

File ui/views/controls/button/label_button.h
Line 349, Patchset 6 (Latest):VIEWS_EXPORT extern const ui::ClassProperty<bool>* const kButtonShowsText;
Kunal Daftari . unresolved

Do we want to create a class property or just add a function to do this behavior?

Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
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: Ib96180cad5ac39c5ec30b296adebdadc6c496911
Gerrit-Change-Number: 6973126
Gerrit-PatchSet: 6
Gerrit-Owner: Kunal Daftari <kunald...@google.com>
Gerrit-Comment-Date: Tue, 23 Sep 2025 23:27:53 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Caroline Rising (Gerrit)

unread,
Sep 24, 2025, 12:54:23 PM (yesterday) Sep 24
to Kunal Daftari, chromium...@chromium.org, roblia...@chromium.org, sky+...@chromium.org
Attention needed from Kunal Daftari

Caroline Rising added 5 comments

File chrome/browser/ui/browser_actions.cc
Line 476, Patchset 6 (Latest): ChromeMenuAction(
Caroline Rising . unresolved

The ChromeMenuAction helper automatically sets the action's actions::kActionItemPinnableKey to be pinnable. This action should probably instead only be pinnable if features::HasTabSearchToolbarButton() is true.

Feel free to instead wait to address this when you address hiding the tab search button in the toolbar but in that case we should add a todo here to remember to come back to that.

File chrome/browser/ui/views/tabs/vertical/vertical_tab_strip_top_button_container.cc
Line 75, Patchset 6 (Latest): tab_search_button->ShrinkDownThenClearText();
Caroline Rising . unresolved

Is this still needed?

Line 63, Patchset 6 (Latest):void VerticalTabStripTopButtonContainer::CreateButtonForTabSearch(
actions::ActionId action_id) {
auto tab_search_button = std::make_unique<views::LabelButton>();
actions::ActionItem* action_item =
actions::ActionManager::Get().FindAction(action_id, root_action_item_);
CHECK(action_item);

action_item->SetProperty(views::kButtonShowsText, false);

action_view_controller_->CreateActionViewRelationship(
tab_search_button.get(), action_item->GetAsWeakPtr());

tab_search_button->ShrinkDownThenClearText();

tab_search_button_ = AddChildView(std::move(tab_search_button));

tab_search_button_->SetHorizontalAlignment(gfx::ALIGN_RIGHT);
}
Caroline Rising . unresolved

Since we will eventually have two buttons in the container could we generalize this method to be used for both? If we turned it into something like ```views::LabelButton* AddChildButtonFor(actions::ActionId action_id)``` then it could be reused. What do you think?

Line 82, Patchset 6 (Latest):bool VerticalTabStripTopButtonContainer::IsPositionInWindowCaption(
Kunal Daftari . resolved

This code was copied from tab_strip_region_view.cc. It does almost exactly the same thing except uses tab_search_button_ instead of new_tab_button_.

Caroline Rising

Sounds good!

File ui/views/controls/button/label_button.h
Line 349, Patchset 6 (Latest):VIEWS_EXPORT extern const ui::ClassProperty<bool>* const kButtonShowsText;
Kunal Daftari . unresolved

Do we want to create a class property or just add a function to do this behavior?

Caroline Rising

The downside to this approach is if this property changes that won't trigger a call to ActionItemChanngedImpl. Since this would only be used for the top container buttons it might be easier to just create a new simple button that inherits from LabelButton (and its ActionViewInterface) in an anonymous namespace in VerticalTabStripTopButtonContainer and have it not call SetText in its ActionItemChangedImpl.

Open in Gerrit

Related details

Attention is currently required from:
  • Kunal Daftari
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
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: Ib96180cad5ac39c5ec30b296adebdadc6c496911
Gerrit-Change-Number: 6973126
Gerrit-PatchSet: 6
Gerrit-Owner: Kunal Daftari <kunald...@google.com>
Gerrit-CC: Caroline Rising <cori...@chromium.org>
Gerrit-Attention: Kunal Daftari <kunald...@google.com>
Gerrit-Comment-Date: Wed, 24 Sep 2025 16:54:18 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Kunal Daftari <kunald...@google.com>
satisfied_requirement
unsatisfied_requirement
open
diffy

Kunal Daftari (Gerrit)

unread,
Sep 24, 2025, 1:42:44 PM (yesterday) Sep 24
to Caroline Rising, chromium...@chromium.org, roblia...@chromium.org, sky+...@chromium.org
Attention needed from Caroline Rising

Kunal Daftari added 5 comments

File chrome/browser/ui/browser_actions.cc
Line 476, Patchset 6: ChromeMenuAction(
Caroline Rising . resolved

The ChromeMenuAction helper automatically sets the action's actions::kActionItemPinnableKey to be pinnable. This action should probably instead only be pinnable if features::HasTabSearchToolbarButton() is true.

Feel free to instead wait to address this when you address hiding the tab search button in the toolbar but in that case we should add a todo here to remember to come back to that.

Kunal Daftari

Done

File chrome/browser/ui/views/frame/browser_view.h
Line 156, Patchset 6: void SetTabSearchBubbleHost();
Kunal Daftari . resolved

Location of function in file could be changed.

Kunal Daftari

Done

File chrome/browser/ui/views/tabs/vertical/vertical_tab_strip_top_button_container.cc
Line 75, Patchset 6: tab_search_button->ShrinkDownThenClearText();
Caroline Rising . resolved

Is this still needed?

Kunal Daftari

Not needed! will remove

Line 63, Patchset 6:void VerticalTabStripTopButtonContainer::CreateButtonForTabSearch(

actions::ActionId action_id) {
auto tab_search_button = std::make_unique<views::LabelButton>();
actions::ActionItem* action_item =
actions::ActionManager::Get().FindAction(action_id, root_action_item_);
CHECK(action_item);

action_item->SetProperty(views::kButtonShowsText, false);

action_view_controller_->CreateActionViewRelationship(
tab_search_button.get(), action_item->GetAsWeakPtr());

tab_search_button->ShrinkDownThenClearText();

tab_search_button_ = AddChildView(std::move(tab_search_button));

tab_search_button_->SetHorizontalAlignment(gfx::ALIGN_RIGHT);
}
Caroline Rising . resolved

Since we will eventually have two buttons in the container could we generalize this method to be used for both? If we turned it into something like ```views::LabelButton* AddChildButtonFor(actions::ActionId action_id)``` then it could be reused. What do you think?

Kunal Daftari

makes sense!

File ui/views/controls/button/label_button.h
Line 349, Patchset 6:VIEWS_EXPORT extern const ui::ClassProperty<bool>* const kButtonShowsText;
Kunal Daftari . unresolved

Do we want to create a class property or just add a function to do this behavior?

Caroline Rising

The downside to this approach is if this property changes that won't trigger a call to ActionItemChanngedImpl. Since this would only be used for the top container buttons it might be easier to just create a new simple button that inherits from LabelButton (and its ActionViewInterface) in an anonymous namespace in VerticalTabStripTopButtonContainer and have it not call SetText in its ActionItemChangedImpl.

Kunal Daftari

That seems like a relatively complex change. If I remember correctly, I was told that this feature might be used in other areas. Does it make more sense to modify the Label Button class directly to accomodate this behavior?

Open in Gerrit

Related details

Attention is currently required from:
  • Caroline Rising
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
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: Ib96180cad5ac39c5ec30b296adebdadc6c496911
Gerrit-Change-Number: 6973126
Gerrit-PatchSet: 7
Gerrit-Owner: Kunal Daftari <kunald...@google.com>
Gerrit-CC: Caroline Rising <cori...@chromium.org>
Gerrit-Attention: Caroline Rising <cori...@chromium.org>
Gerrit-Comment-Date: Wed, 24 Sep 2025 17:42:35 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Caroline Rising <cori...@chromium.org>
Comment-In-Reply-To: Kunal Daftari <kunald...@google.com>
satisfied_requirement
unsatisfied_requirement
open
diffy

Caroline Rising (Gerrit)

unread,
9:26 AM (10 hours ago) 9:26 AM
to Kunal Daftari, Chromium LUCI CQ, chromium...@chromium.org, roblia...@chromium.org, sky+...@chromium.org
Attention needed from Kunal Daftari

Caroline Rising added 3 comments

File chrome/browser/ui/browser_actions.cc
Line 474, Patchset 12 (Latest): // TODO(crbug.com/447146648): Ensure that tab search button is not created
Caroline Rising . unresolved

nit let's change this to "is not pinnable". If tab search needs to be able to be seen again (and pinned to the toolbar again) if you switch back to horizontal tabs, then we will need to update the pinnable state for tab search when switching between vertical and horizontal tabs.

File chrome/browser/ui/tabs/vertical_tab_strip_state_controller_interactive_uitest.cc
Line 123, Patchset 12 (Latest):// This test checks that we can click the tab search button in the vertical tab
// strip
IN_PROC_BROWSER_TEST_F(VerticalTabStripInteractiveUiTest,
VerifyTabSearchButton) {
browser()
->browser_window_features()
->vertical_tab_strip_state_controller()
->SetVerticalTabsEnabled(true);

RunScheduledLayouts();

RunTestSequence(WaitForShow(kVerticalTabStripTopButtonContainerElementId),
EnsurePresent(kVerticalTabStripTabSearchElementId),
MoveMouseTo(kVerticalTabStripTabSearchElementId),
ClickMouse(), WaitForShow(kTabSearchBubbleElementId));
}
Caroline Rising . unresolved

nit this test should probably be in a different file since it is not testing anything related to the vertical tabs state controller

File chrome/browser/ui/views/tabs/vertical/vertical_tab_strip_top_button_container.cc
Line 84, Patchset 12 (Latest): return label_button;
Caroline Rising . unresolved

Could we add the child view here and just return a labelbutton pointer? Also if SetHorizontalAlignment(gfx::ALIGN_RIGHT); will be set for both buttons can that be moved back in here too?

Open in Gerrit

Related details

Attention is currently required from:
  • Kunal Daftari
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
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: Ib96180cad5ac39c5ec30b296adebdadc6c496911
Gerrit-Change-Number: 6973126
Gerrit-PatchSet: 12
Gerrit-Owner: Kunal Daftari <kunald...@google.com>
Gerrit-Reviewer: Kunal Daftari <kunald...@google.com>
Gerrit-CC: Caroline Rising <cori...@chromium.org>
Gerrit-Attention: Kunal Daftari <kunald...@google.com>
Gerrit-Comment-Date: Thu, 25 Sep 2025 13:26:20 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Kunal Daftari (Gerrit)

unread,
12:05 PM (8 hours ago) 12:05 PM
to Chromium LUCI CQ, Caroline Rising, chromium...@chromium.org, roblia...@chromium.org, sky+...@chromium.org
Attention needed from Caroline Rising

Kunal Daftari added 2 comments

File chrome/browser/ui/browser_actions.cc
Line 474, Patchset 12: // TODO(crbug.com/447146648): Ensure that tab search button is not created
Caroline Rising . resolved

nit let's change this to "is not pinnable". If tab search needs to be able to be seen again (and pinned to the toolbar again) if you switch back to horizontal tabs, then we will need to update the pinnable state for tab search when switching between vertical and horizontal tabs.

Kunal Daftari

Done

File chrome/browser/ui/views/tabs/vertical/vertical_tab_strip_top_button_container.cc
Line 84, Patchset 12: return label_button;
Caroline Rising . resolved

Could we add the child view here and just return a labelbutton pointer? Also if SetHorizontalAlignment(gfx::ALIGN_RIGHT); will be set for both buttons can that be moved back in here too?

Kunal Daftari

Done

Open in Gerrit

Related details

Attention is currently required from:
  • Caroline Rising
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
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: Ib96180cad5ac39c5ec30b296adebdadc6c496911
Gerrit-Change-Number: 6973126
Gerrit-PatchSet: 13
Gerrit-Owner: Kunal Daftari <kunald...@google.com>
Gerrit-Reviewer: Kunal Daftari <kunald...@google.com>
Gerrit-CC: Caroline Rising <cori...@chromium.org>
Gerrit-Attention: Caroline Rising <cori...@chromium.org>
Gerrit-Comment-Date: Thu, 25 Sep 2025 16:05:07 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Caroline Rising <cori...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Caroline Rising (Gerrit)

unread,
1:18 PM (7 hours ago) 1:18 PM
to Kunal Daftari, Chromium LUCI CQ, chromium...@chromium.org, roblia...@chromium.org, sky+...@chromium.org
Attention needed from Kunal Daftari

Caroline Rising added 1 comment

File chrome/browser/ui/views/tabs/vertical/vertical_tab_strip_top_button_container.cc
Line 16, Patchset 13 (Latest):namespace {
constexpr int kTopButtonContainerHeight = 28;
} // namespace
Caroline Rising . unresolved

As we talked about, defining the button would look something like this
```suggestion
namespace {
constexpr int kTopButtonContainerHeight = 28;

// Class comment here about what this is.
class TopContainerButton : public views::LabelButton {
METADATA_HEADER(TopContainerButton, views::LabelButton)
public:
TopContainerButton() : LabelButton() {}
// add destructor, etc.

// views::LabelButton:
std::unique_ptr<ActionViewInterface> GetActionViewInterface() override {
// create in action view interface
}
};
BEGIN_METADATA(TopContainerButton)
END_METADATA
class TopContainerButtonActionViewInterface : public views::LabelButtonActionViewInterface {
{
public:
// Add constructor/destructor.
  // LabelButtonActionViewInterface:
void ActionItemChangedImpl(actions::ActionItem* action_item) override {
// Set needed properties.
}
 private:
raw_ptr<TopContainerButton> action_view_;
};
} // namespace
```
Open in Gerrit

Related details

Attention is currently required from:
  • Kunal Daftari
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
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: Ib96180cad5ac39c5ec30b296adebdadc6c496911
Gerrit-Change-Number: 6973126
Gerrit-PatchSet: 13
Gerrit-Owner: Kunal Daftari <kunald...@google.com>
Gerrit-Reviewer: Kunal Daftari <kunald...@google.com>
Gerrit-CC: Caroline Rising <cori...@chromium.org>
Gerrit-Attention: Kunal Daftari <kunald...@google.com>
Gerrit-Comment-Date: Thu, 25 Sep 2025 17:18:38 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Kunal Daftari (Gerrit)

unread,
3:31 PM (4 hours ago) 3:31 PM
to Chromium LUCI CQ, Caroline Rising, chromium...@chromium.org, roblia...@chromium.org, sky+...@chromium.org
Attention needed from Caroline Rising

Kunal Daftari added 2 comments

File chrome/browser/ui/views/tabs/vertical/vertical_tab_strip_top_button_container.cc

constexpr int kTopButtonContainerHeight = 28;
} // namespace
Caroline Rising . resolved

As we talked about, defining the button would look something like this
```suggestion
namespace {
constexpr int kTopButtonContainerHeight = 28;

// Class comment here about what this is.
class TopContainerButton : public views::LabelButton {
METADATA_HEADER(TopContainerButton, views::LabelButton)
public:
TopContainerButton() : LabelButton() {}
// add destructor, etc.

// views::LabelButton:
std::unique_ptr<ActionViewInterface> GetActionViewInterface() override {
// create in action view interface
}
};
BEGIN_METADATA(TopContainerButton)
END_METADATA
class TopContainerButtonActionViewInterface : public views::LabelButtonActionViewInterface {
{
public:
// Add constructor/destructor.
  // LabelButtonActionViewInterface:
void ActionItemChangedImpl(actions::ActionItem* action_item) override {
// Set needed properties.
}
 private:
raw_ptr<TopContainerButton> action_view_;
};
} // namespace
```
Kunal Daftari

Done

File ui/views/controls/button/label_button.h
Line 349, Patchset 6:VIEWS_EXPORT extern const ui::ClassProperty<bool>* const kButtonShowsText;
Kunal Daftari . resolved

Do we want to create a class property or just add a function to do this behavior?

Caroline Rising

The downside to this approach is if this property changes that won't trigger a call to ActionItemChanngedImpl. Since this would only be used for the top container buttons it might be easier to just create a new simple button that inherits from LabelButton (and its ActionViewInterface) in an anonymous namespace in VerticalTabStripTopButtonContainer and have it not call SetText in its ActionItemChangedImpl.

Kunal Daftari

That seems like a relatively complex change. If I remember correctly, I was told that this feature might be used in other areas. Does it make more sense to modify the Label Button class directly to accomodate this behavior?

Kunal Daftari

Done

Open in Gerrit

Related details

Attention is currently required from:
  • Caroline Rising
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
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: Ib96180cad5ac39c5ec30b296adebdadc6c496911
Gerrit-Change-Number: 6973126
Gerrit-PatchSet: 14
Gerrit-Owner: Kunal Daftari <kunald...@google.com>
Gerrit-Reviewer: Kunal Daftari <kunald...@google.com>
Gerrit-CC: Caroline Rising <cori...@chromium.org>
Gerrit-Attention: Caroline Rising <cori...@chromium.org>
Gerrit-Comment-Date: Thu, 25 Sep 2025 19:31:24 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Eshwar Stalin (Gerrit)

unread,
5:59 PM (2 hours ago) 5:59 PM
to Kunal Daftari, Chromium LUCI CQ, Caroline Rising, chromium...@chromium.org, roblia...@chromium.org, sky+...@chromium.org
Attention needed from Caroline Rising and Kunal Daftari

Eshwar Stalin added 1 comment

File chrome/browser/ui/views/frame/browser_view.cc
Line 1135, Patchset 14 (Latest): tab_search_bubble_host_ = std::make_unique<TabSearchBubbleHost>(
Eshwar Stalin . unresolved

The biggest issue here is this would result in a UAF for the tab_search_toolbar_button_controller since it has a raw ptr to the TabSearchBubbleHost. Moreover, there is also a correctness issue where invoking the toolbar button would open the bubble host in the vertical tab strip entrypoint. So we need to handle these two. Still don't have a great recommendation.

Open in Gerrit

Related details

Attention is currently required from:
  • Caroline Rising
  • Kunal Daftari
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
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: Ib96180cad5ac39c5ec30b296adebdadc6c496911
Gerrit-Change-Number: 6973126
Gerrit-PatchSet: 14
Gerrit-Owner: Kunal Daftari <kunald...@google.com>
Gerrit-Reviewer: Kunal Daftari <kunald...@google.com>
Gerrit-CC: Caroline Rising <cori...@chromium.org>
Gerrit-CC: Eshwar Stalin <est...@chromium.org>
Gerrit-Attention: Caroline Rising <cori...@chromium.org>
Gerrit-Attention: Kunal Daftari <kunald...@google.com>
Gerrit-Comment-Date: Thu, 25 Sep 2025 21:59:22 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy
Reply all
Reply to author
Forward
0 new messages