Commit 74064adc authored by Bret Sepulveda's avatar Bret Sepulveda Committed by Commit Bot

Fix home button not having an ink drop when toggled on.

The home button's width was being set to 0 when it was off, which caused
its ink drop to be also set to size 0, but the ink drop isn't updated
when the bounds change later. This patch fixes this by having the home
button's width never be set to 0.

A test was hitting a DCHECK because of this, so that test is re-enabled.

Bug: 853990
Change-Id: I5313aead457c4c51db6c8201ad9bc8e652935e52
Reviewed-on: https://chromium-review.googlesource.com/1109270Reviewed-by: default avatarDavid Tseng <dtseng@chromium.org>
Commit-Queue: Bret Sepulveda <bsep@chromium.org>
Cr-Commit-Position: refs/heads/master@{#569826}
parent c7e4c0d0
......@@ -140,12 +140,6 @@ IN_PROC_BROWSER_TEST_F(StickyKeysBrowserTest, OpenNewTabs) {
}
IN_PROC_BROWSER_TEST_F(StickyKeysBrowserTest, CtrlClickHomeButton) {
if (ui::MaterialDesignController::IsRefreshUi()) {
// TODO(bsep): crbug.com/853990 Running the message loop in ClickOnView hits
// a DCHECK in cc::layer for unknown reasons. Needs investigation.
return;
}
// Show home page button.
browser()->profile()->GetPrefs()->SetBoolean(prefs::kShowHomeButton, true);
TabStripModel* tab_strip_model = browser()->tab_strip_model();
......
......@@ -521,19 +521,19 @@ void ToolbarView::Layout() {
toolbar_button_height);
next_element_x = reload_->bounds().right();
home_->SetSize(
gfx::Size(home_->GetPreferredSize().width(), toolbar_button_height));
if (show_home_button_.GetValue() ||
(browser_->is_app() && extensions::util::IsNewBookmarkAppsEnabled())) {
next_element_x += element_padding;
home_->SetVisible(true);
home_->SetBounds(next_element_x, toolbar_button_y,
home_->GetPreferredSize().width(), toolbar_button_height);
next_element_x += element_padding;
home_->SetPosition(gfx::Point(next_element_x, toolbar_button_y));
next_element_x += home_->width();
} else {
home_->SetVisible(false);
home_->SetBounds(next_element_x, toolbar_button_y, 0,
toolbar_button_height);
}
next_element_x =
home_->bounds().right() + GetLayoutConstant(TOOLBAR_STANDARD_SPACING);
next_element_x += GetLayoutConstant(TOOLBAR_STANDARD_SPACING);
int app_menu_width = app_menu_button_->GetPreferredSize().width();
const int right_padding = GetLayoutConstant(TOOLBAR_STANDARD_SPACING);
......
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