Commit 92d78c90 authored by siyua's avatar siyua Committed by Commit Bot

[AF][Status Chip] Change the page action icon size

If the icon is in toolbar page action icon container, the ink drop bound
should not follow the omnibox page action icon size. Instead, it should be
like other toolbar buttons.

Uploaded screenshot in bug comment 23

Bug: 932818
Change-Id: I8cdb74b168f3977aff2506c6ae673006b595325b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1716385Reviewed-by: default avatarPeter Boström <pbos@chromium.org>
Commit-Queue: Siyu An <siyua@chromium.org>
Cr-Commit-Position: refs/heads/master@{#681481}
parent 63d89de2
......@@ -23,6 +23,12 @@
#include "ui/views/controls/focus_ring.h"
#include "ui/views/style/platform_style.h"
std::unique_ptr<views::Border>
PageActionIconView::Delegate::GetPageActionIconBorder() const {
return views::CreateEmptyBorder(
GetLayoutInsets(LOCATION_BAR_ICON_INTERIOR_PADDING));
}
bool PageActionIconView::Delegate::IsLocationBarUserInputInProgress() const {
return false;
}
......@@ -211,6 +217,5 @@ content::WebContents* PageActionIconView::GetWebContents() const {
}
void PageActionIconView::UpdateBorder() {
SetBorder(views::CreateEmptyBorder(
GetLayoutInsets(LOCATION_BAR_ICON_INTERIOR_PADDING)));
SetBorder(delegate_->GetPageActionIconBorder());
}
......@@ -44,6 +44,10 @@ class PageActionIconView : public IconLabelBubbleView {
virtual content::WebContents* GetWebContentsForPageActionIconView() = 0;
// Returns the border the icon should use. It depends on what kind of
// delegate this icon has.
virtual std::unique_ptr<views::Border> GetPageActionIconBorder() const;
// Delegate should override and return true when the user is editing the
// location bar contents.
virtual bool IsLocationBarUserInputInProgress() const;
......
......@@ -126,6 +126,14 @@ ToolbarPageActionIconContainerView::GetWebContentsForPageActionIconView() {
return browser_->tab_strip_model()->GetActiveWebContents();
}
std::unique_ptr<views::Border>
ToolbarPageActionIconContainerView::GetPageActionIconBorder() const {
// With this border, the icon will have the same ink drop shape as toolbar
// buttons.
return views::CreateEmptyBorder(ChromeLayoutProvider::Get()->GetInsetsMetric(
views::InsetsMetric::INSETS_LABEL_BUTTON));
}
void ToolbarPageActionIconContainerView::OnThemeChanged() {
// Update icon color.
UpdateAllIcons();
......
......@@ -44,6 +44,7 @@ class ToolbarPageActionIconContainerView : public ToolbarIconContainerView,
// PageActionIconView::Delegate:
SkColor GetPageActionInkDropColor() const override;
content::WebContents* GetWebContentsForPageActionIconView() override;
std::unique_ptr<views::Border> GetPageActionIconBorder() const override;
// views::View:
void OnThemeChanged() override;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment