[go: up one dir, main page]

Call superclass Layout() from NewTabButton::Layout()

The new NewTabButton::Layout() override stopped the FocusRing from
being laid out. As a result, the focus ring no longer appeared. By
calling the superclass Layout() first we ensure FocusRing::Layout() is
also called.

This also fixes the naming of |ink_drop_container_|.

(cherry picked from commit 4641862d47f048ec0c4d1c2f3519db4b2b248ba9)

Bug: 971860
Change-Id: I8fbc5c01f89d831fd36e3cb87e7d7cca1c85fce4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1650681
Reviewed-by: Dana Fried <dfried@chromium.org>
Commit-Queue: Collin Baker <collinbaker@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#667393}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1652712
Reviewed-by: Collin Baker <collinbaker@chromium.org>
Cr-Commit-Position: refs/branch-heads/3809@{#204}
Cr-Branched-From: d82dec1a818f378c464ba307ddd9c92133eac355-refs/heads/master@{#665002}
diff --git a/chrome/browser/ui/views/tabs/new_tab_button.cc b/chrome/browser/ui/views/tabs/new_tab_button.cc
index cf9ea00a..6591b13 100644
--- a/chrome/browser/ui/views/tabs/new_tab_button.cc
+++ b/chrome/browser/ui/views/tabs/new_tab_button.cc
@@ -74,7 +74,7 @@
                               ui::EF_MIDDLE_MOUSE_BUTTON);
 #endif
 
-  ink_drop_container =
+  ink_drop_container_ =
       AddChildView(std::make_unique<views::InkDropContainerView>());
 
   SetInkDropMode(InkDropMode::ON);
@@ -133,15 +133,16 @@
 }
 
 void NewTabButton::Layout() {
-  ink_drop_container->SetBoundsRect(GetLocalBounds());
+  views::ImageButton::Layout();
+  ink_drop_container_->SetBoundsRect(GetLocalBounds());
 }
 
 void NewTabButton::AddLayerBeneathView(ui::Layer* new_layer) {
-  ink_drop_container->AddLayerBeneathView(new_layer);
+  ink_drop_container_->AddLayerBeneathView(new_layer);
 }
 
 void NewTabButton::RemoveLayerBeneathView(ui::Layer* old_layer) {
-  ink_drop_container->RemoveLayerBeneathView(old_layer);
+  ink_drop_container_->RemoveLayerBeneathView(old_layer);
 }
 
 #if defined(OS_WIN)
diff --git a/chrome/browser/ui/views/tabs/new_tab_button.h b/chrome/browser/ui/views/tabs/new_tab_button.h
index 4e0ebf7..211faf8 100644
--- a/chrome/browser/ui/views/tabs/new_tab_button.h
+++ b/chrome/browser/ui/views/tabs/new_tab_button.h
@@ -111,7 +111,7 @@
   TabStrip* tab_strip_;
 
   // Contains our ink drop layer so it can paint above our background.
-  views::InkDropContainerView* ink_drop_container;
+  views::InkDropContainerView* ink_drop_container_;
 
   // Promotional UI that appears next to the NewTabButton and encourages its
   // use. Owned by its NativeWidget.