Revert "Animate side panel opening and closing."
This reverts commit 7b94b89e9eb2ffee570579022eb3b488c97b23b5.
Reason for revert:
Test flaking on Linux bots:
https://luci-analysis.appspot.com/p/chromium/clusters/reason-v6/db6c8ae7f402e859108f17fdf2e06c81?selectedMetrics=human-cls-failed-presubmit%2Ccritical-failures-exonerated%2Cfailures%2Cbuilds-failed-due-to-flaky-tests&historyTimeRange=30d&annotated=false&tab=recent-failures
First failing build: https://ci.chromium.org/ui/p/chromium/builders/ci/Linux%20Tests/143020/test-results?sortby=&groupby=
Original change's description:
> Animate side panel opening and closing.
>
> Create an animation that slides the side panel out from the side of the
> browser. This updates the side panel and side panel coordinator to use
> an enum, SidePanelContentState, to convey when a view should be hidden
> and allow us to delay hiding it until the side panel has been closed.
>
> Bug: 328295071
> Change-Id: I40b099a1a3d0469ba815caf152fb0ecc3562af2f
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5406892
> Commit-Queue: Caroline Rising <corising@chromium.org>
> Reviewed-by: David Pennington <dpenning@chromium.org>
> Reviewed-by: Eshwar Stalin <estalin@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1280923}
Bug: 328295071
Change-Id: I2465322bf6ee20e3187b585c8e1739e4746b2548
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5403783
Owners-Override: Alan Cutter <alancutter@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Auto-Submit: Alan Cutter <alancutter@google.com>
Commit-Queue: Alan Cutter <alancutter@google.com>
Cr-Commit-Position: refs/heads/main@{#1280996}
diff --git a/chrome/browser/ui/side_panel/side_panel_enums.h b/chrome/browser/ui/side_panel/side_panel_enums.h
index c1ee60d04..a2300ea 100644
--- a/chrome/browser/ui/side_panel/side_panel_enums.h
+++ b/chrome/browser/ui/side_panel/side_panel_enums.h
@@ -29,17 +29,7 @@
kReadAnythingOmniboxIcon = 15,
kReadAnythingNavigationThrottle = 16,
kOverflowMenu = 17,
- kExtension = 18,
- kMaxValue = kExtension,
-};
-
-enum class SidePanelContentState {
- // Content is ready to show and will influence side panel visibility.
- kReadyToShow = 0,
- // Side panel content should be hidden, either immediately if other content
- // is causing the side panel to remain open or after the side panel has been
- // closed.
- kReadyToHide = 1,
+ kMaxValue = kOverflowMenu,
};
#endif // CHROME_BROWSER_UI_SIDE_PANEL_SIDE_PANEL_ENUMS_H_
diff --git a/chrome/browser/ui/side_panel/side_panel_ui.h b/chrome/browser/ui/side_panel/side_panel_ui.h
index a22dbf4..f9d7c8e5 100644
--- a/chrome/browser/ui/side_panel/side_panel_ui.h
+++ b/chrome/browser/ui/side_panel/side_panel_ui.h
@@ -82,8 +82,6 @@
// does not exist.
virtual content::WebContents* GetWebContentsForTest(SidePanelEntryId id) = 0;
- virtual void DisableAnimationsForTesting() = 0;
-
private:
static const int kUserDataKey = 0;
};
diff --git a/chrome/browser/ui/views/frame/browser_view.cc b/chrome/browser/ui/views/frame/browser_view.cc
index 2e1b457..93c0de48 100644
--- a/chrome/browser/ui/views/frame/browser_view.cc
+++ b/chrome/browser/ui/views/frame/browser_view.cc
@@ -4436,14 +4436,15 @@
// TODO(pbos): Investigate whether the side panels should be creatable when
// the ToolbarView does not create a button for them. This specifically seems
// to hit web apps. See https://crbug.com/1267781.
- if (toolbar_->GetSidePanelButton()) {
+ if (toolbar_->GetSidePanelButton() && unified_side_panel_) {
if (toolbar()->side_panel_container()) {
toolbar()->side_panel_container()->ObserveSidePanelView(
unified_side_panel_);
+ } else {
+ unified_side_panel_->AddObserver(
+ SidePanelUtil::GetSidePanelCoordinatorForBrowser((browser_.get())));
}
}
- unified_side_panel_->AddObserver(
- SidePanelUtil::GetSidePanelCoordinatorForBrowser((browser_.get())));
#if BUILDFLAG(IS_CHROMEOS)
// TopControlsSlideController must be initialized here in AddedToWidget()
diff --git a/chrome/browser/ui/views/frame/browser_view_layout.cc b/chrome/browser/ui/views/frame/browser_view_layout.cc
index 07bc84f..0991a57 100644
--- a/chrome/browser/ui/views/frame/browser_view_layout.cc
+++ b/chrome/browser/ui/views/frame/browser_view_layout.cc
@@ -736,13 +736,9 @@
contents_container_bounds.width() - GetMinWebContentsWidth() -
side_panel_separator->GetPreferredSize().width()));
- double side_panel_visible_width =
- side_panel_bounds.width() *
- views::AsViewClass<SidePanel>(unified_side_panel_)->GetAnimationValue();
-
// Shrink container bounds to fit the side panel.
contents_container_bounds.set_width(
- contents_container_bounds.width() - side_panel_visible_width -
+ contents_container_bounds.width() - side_panel_bounds.width() -
side_panel_separator->GetPreferredSize().width());
// In LTR, the point (0,0) represents the top left of the browser.
@@ -756,10 +752,8 @@
// to the ui direction, move `contents_container_bounds` after the side
// panel. Also leave space for the separator.
contents_container_bounds.set_x(
- side_panel_visible_width +
+ side_panel_bounds.width() +
side_panel_separator->GetPreferredSize().width());
- side_panel_bounds.set_x(side_panel_bounds.x() - (side_panel_bounds.width() -
- side_panel_visible_width));
} else {
// When the side panel should appear after the main content area relative to
// the ui direction, move `side_panel_bounds` after the main content area.
diff --git a/chrome/browser/ui/views/page_info/about_this_site_side_panel_coordinator_browsertest.cc b/chrome/browser/ui/views/page_info/about_this_site_side_panel_coordinator_browsertest.cc
index ab0a114..409ac8e2 100644
--- a/chrome/browser/ui/views/page_info/about_this_site_side_panel_coordinator_browsertest.cc
+++ b/chrome/browser/ui/views/page_info/about_this_site_side_panel_coordinator_browsertest.cc
@@ -11,7 +11,6 @@
#include "chrome/browser/ui/views/frame/browser_view.h"
#include "chrome/browser/ui/views/side_panel/side_panel_coordinator.h"
#include "chrome/browser/ui/views/side_panel/side_panel_entry.h"
-#include "chrome/browser/ui/views/side_panel/side_panel_test_utils.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/ui_test_utils.h"
#include "components/page_info/core/about_this_site_service.h"
@@ -297,7 +296,6 @@
// Close side panel.
side_panel_coordinator()->Close();
- SidePanelWaiter(side_panel_coordinator()).WaitForSidePanelClose();
EXPECT_FALSE(side_panel_coordinator()->IsSidePanelShowing());
ASSERT_EQ(side_panel_coordinator()->GetCurrentEntryId(), std::nullopt);
diff --git a/chrome/browser/ui/views/performance_controls/memory_saver_chip_view_unittest.cc b/chrome/browser/ui/views/performance_controls/memory_saver_chip_view_unittest.cc
index d49781e4..e27d8e4 100644
--- a/chrome/browser/ui/views/performance_controls/memory_saver_chip_view_unittest.cc
+++ b/chrome/browser/ui/views/performance_controls/memory_saver_chip_view_unittest.cc
@@ -305,8 +305,6 @@
};
TEST_F(MemorySaverChipViewWithPerformanceSidePanelTest, OpensSidePanel) {
- SidePanelUtil::GetSidePanelCoordinatorForBrowser(browser())
- ->SetNoDelaysForTesting(true);
SetTabDiscardState(0, true);
EXPECT_TRUE(GetPageActionIconView()->GetVisible());
diff --git a/chrome/browser/ui/views/side_panel/extensions/extension_side_panel_browsertest.cc b/chrome/browser/ui/views/side_panel/extensions/extension_side_panel_browsertest.cc
index 36b7242..74c3b7c6 100644
--- a/chrome/browser/ui/views/side_panel/extensions/extension_side_panel_browsertest.cc
+++ b/chrome/browser/ui/views/side_panel/extensions/extension_side_panel_browsertest.cc
@@ -26,7 +26,6 @@
#include "chrome/browser/ui/views/side_panel/side_panel_entry_observer.h"
#include "chrome/browser/ui/views/side_panel/side_panel_registry.h"
#include "chrome/browser/ui/views/side_panel/side_panel_registry_observer.h"
-#include "chrome/browser/ui/views/side_panel/side_panel_test_utils.h"
#include "chrome/browser/ui/views/toolbar/toolbar_view.h"
#include "chrome/test/base/ui_test_utils.h"
#include "components/crx_file/id_util.h"
@@ -229,7 +228,6 @@
RunSetOptions(extension, GetCurrentTabId(), /*path=*/std::nullopt,
/*enabled=*/false);
waiter.WaitForDeregistration();
- SidePanelWaiter(side_panel_coordinator()).WaitForSidePanelClose();
EXPECT_FALSE(global_registry()->GetEntryForKey(GetKey(extension.id())));
EXPECT_FALSE(side_panel_coordinator()->IsSidePanelShowing());
}
@@ -274,24 +272,6 @@
->extensions_container();
}
- void WaitForSidePanelToolbarCloseButtonVisibility(bool visible) {
- auto* button =
- GetExtensionsToolbarContainer()->GetCloseSidePanelButtonForTesting();
- if (visible == false && !GetExtensionsToolbarContainer()->GetVisible()) {
- return;
- }
-
- if (button->GetVisible() == visible) {
- return;
- }
-
- base::RunLoop run_loop;
- auto subscription =
- button->AddVisibleChangedCallback(run_loop.QuitClosure());
- run_loop.Run();
- EXPECT_EQ(visible, button->GetVisible());
- }
-
extensions::ExtensionContextMenuModel* GetContextMenuForExtension(
const ExtensionId& extension_id) {
return static_cast<extensions::ExtensionContextMenuModel*>(
@@ -439,11 +419,8 @@
// Reset the `default_path_listener`.
default_path_listener.Reset();
- SidePanelWaiter side_panel_waiter(side_panel_coordinator());
-
// Close and reopen the side panel. The extension's view should be recreated.
side_panel_coordinator()->Close();
- side_panel_waiter.WaitForSidePanelClose();
EXPECT_FALSE(side_panel_coordinator()->IsSidePanelShowing());
side_panel_coordinator()->Show(extension_key);
@@ -453,7 +430,6 @@
// Now unload the extension. The key should no longer exist in the global
// registry and the side panel should close as a result.
UnloadExtension(extension->id());
- side_panel_waiter.WaitForSidePanelClose();
EXPECT_FALSE(global_registry()->GetEntryForKey(extension_key));
EXPECT_FALSE(side_panel_coordinator()->IsSidePanelShowing());
}
@@ -616,7 +592,6 @@
RunSetOptions(*extension, /*tab_id=*/std::nullopt, /*path=*/std::nullopt,
/*enabled=*/false);
waiter.WaitForDeregistration();
- SidePanelWaiter(side_panel_coordinator()).WaitForSidePanelClose();
}
EXPECT_FALSE(global_registry()->GetEntryForKey(extension_key));
@@ -890,7 +865,6 @@
ExtensionSidePanelRegistryWaiter waiter(global_registry(), extension->id());
browser()->tab_strip_model()->ActivateTabAt(0);
waiter.WaitForDeregistration();
- SidePanelWaiter(side_panel_coordinator()).WaitForSidePanelClose();
EXPECT_FALSE(global_registry()->GetEntryForKey(extension_key));
EXPECT_FALSE(side_panel_coordinator()->IsSidePanelShowing());
}
@@ -922,7 +896,6 @@
RunSetOptions(*extension, GetCurrentTabId(), /*path=*/std::nullopt,
/*enabled=*/false);
waiter.WaitForDeregistration();
- SidePanelWaiter(side_panel_coordinator()).WaitForSidePanelClose();
EXPECT_FALSE(global_registry()->GetEntryForKey(extension_key));
EXPECT_FALSE(side_panel_coordinator()->IsSidePanelShowing());
}
@@ -995,7 +968,6 @@
ExtensionSidePanelRegistryWaiter waiter(global_registry(), extension->id());
browser()->tab_strip_model()->ActivateTabAt(1);
waiter.WaitForDeregistration();
- SidePanelWaiter(side_panel_coordinator()).WaitForSidePanelClose();
EXPECT_FALSE(global_registry()->GetEntryForKey(extension_key));
EXPECT_FALSE(side_panel_coordinator()->IsSidePanelShowing());
}
@@ -1244,7 +1216,6 @@
// Unloading the extension at this point should not crash the browser.
UnloadExtension(extension->id());
- SidePanelWaiter(side_panel_coordinator()).WaitForSidePanelClose();
EXPECT_FALSE(side_panel_coordinator()->IsSidePanelShowing());
}
@@ -1396,10 +1367,11 @@
// registry and the side panel should close as a result and the close side
// panel button should not be visible.
UnloadExtension(extension->id());
- SidePanelWaiter(side_panel_coordinator()).WaitForSidePanelClose();
EXPECT_FALSE(global_registry()->GetEntryForKey(extension_key));
EXPECT_FALSE(side_panel_coordinator()->IsSidePanelShowing());
- WaitForSidePanelToolbarCloseButtonVisibility(false);
+ EXPECT_FALSE(GetExtensionsToolbarContainer()
+ ->GetCloseSidePanelButtonForTesting()
+ ->GetVisible());
}
class ExtensionOpenSidePanelBrowserTest : public ExtensionSidePanelBrowserTest {
@@ -2034,7 +2006,6 @@
// Clicking on the menu item again should close the side panel.
menu->ExecuteCommand(
extensions::ExtensionContextMenuModel::TOGGLE_SIDE_PANEL_VISIBILITY, 0);
- SidePanelWaiter(side_panel_coordinator()).WaitForSidePanelClose();
EXPECT_FALSE(side_panel_coordinator()->IsSidePanelEntryShowing(
GetKey(side_panel_extension->id())));
}
@@ -2077,7 +2048,6 @@
// Clicking on the menu item again should close the side panel.
menu->ExecuteCommand(
extensions::ExtensionContextMenuModel::TOGGLE_SIDE_PANEL_VISIBILITY, 0);
- SidePanelWaiter(side_panel_coordinator()).WaitForSidePanelClose();
EXPECT_FALSE(side_panel_coordinator()->IsSidePanelEntryShowing(
GetKey(side_panel_extension->id())));
}
diff --git a/chrome/browser/ui/views/side_panel/extensions/extension_side_panel_coordinator.cc b/chrome/browser/ui/views/side_panel/extensions/extension_side_panel_coordinator.cc
index 3b63087..fe4312c 100644
--- a/chrome/browser/ui/views/side_panel/extensions/extension_side_panel_coordinator.cc
+++ b/chrome/browser/ui/views/side_panel/extensions/extension_side_panel_coordinator.cc
@@ -337,6 +337,10 @@
} else {
entry->ClearCachedView();
}
+
+ // Closing the panel or removing the view should synchronously result in
+ // the extension view being destroyed, which destroys `host_`.
+ DCHECK(!host_);
}
void ExtensionSidePanelCoordinator::NavigateIfNecessary() {
diff --git a/chrome/browser/ui/views/side_panel/extensions/extension_side_panel_utils.cc b/chrome/browser/ui/views/side_panel/extensions/extension_side_panel_utils.cc
index 2d37112..8d45fe1 100644
--- a/chrome/browser/ui/views/side_panel/extensions/extension_side_panel_utils.cc
+++ b/chrome/browser/ui/views/side_panel/extensions/extension_side_panel_utils.cc
@@ -27,7 +27,11 @@
SidePanelEntry::Key extension_key =
SidePanelEntry::Key(SidePanelEntry::Id::kExtension, extension_id);
- side_panel_ui->Toggle(extension_key, SidePanelOpenTrigger::kExtension);
+ if (side_panel_ui->IsSidePanelEntryShowing(extension_key)) {
+ side_panel_ui->Close();
+ } else {
+ side_panel_ui->Show(extension_key);
+ }
}
// Declared in extension_side_panel_utils.h
diff --git a/chrome/browser/ui/views/side_panel/side_panel.cc b/chrome/browser/ui/views/side_panel/side_panel.cc
index e0497047..72ed32b6 100644
--- a/chrome/browser/ui/views/side_panel/side_panel.cc
+++ b/chrome/browser/ui/views/side_panel/side_panel.cc
@@ -9,11 +9,9 @@
#include "base/functional/bind.h"
#include "base/i18n/rtl.h"
#include "base/memory/raw_ptr.h"
-#include "base/time/time.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser_element_identifiers.h"
#include "chrome/browser/ui/color/chrome_color_id.h"
-#include "chrome/browser/ui/side_panel/side_panel_enums.h"
#include "chrome/browser/ui/ui_features.h"
#include "chrome/browser/ui/views/frame/browser_view.h"
#include "chrome/browser/ui/views/frame/top_container_background.h"
@@ -21,7 +19,6 @@
#include "chrome/browser/ui/views/side_panel/side_panel_resize_area.h"
#include "chrome/browser/ui/views/side_panel/side_panel_util.h"
#include "chrome/common/pref_names.h"
-#include "components/lens/lens_features.h"
#include "third_party/skia/include/core/SkPath.h"
#include "ui/base/metadata/metadata_impl_macros.h"
#include "ui/base/ui_base_features.h"
@@ -64,8 +61,6 @@
kBorderThickness,
kBorderThickness);
-constexpr int kAnimationDurationMs = 450;
-
// This border paints the toolbar color around the side panel content and draws
// a roundrect viewport around the side panel content. The border can have
// rounded corners of its own.
@@ -222,19 +217,11 @@
SidePanel::SidePanel(BrowserView* browser_view,
HorizontalAlignment horizontal_alignment)
- : views::AnimationDelegateViews(this),
+ : border_view_(AddChildView(std::make_unique<BorderView>(browser_view))),
browser_view_(browser_view),
+ resize_area_(
+ AddChildView(std::make_unique<views::SidePanelResizeArea>(this))),
horizontal_alignment_(horizontal_alignment) {
- std::unique_ptr<BorderView> border_view =
- std::make_unique<BorderView>(browser_view);
- border_view_ = border_view.get();
- AddChildView(std::move(border_view));
-
- std::unique_ptr<views::SidePanelResizeArea> resize_area =
- std::make_unique<views::SidePanelResizeArea>(this);
- resize_area_ = resize_area.get();
- AddChildView(std::move(resize_area));
-
pref_change_registrar_.Init(browser_view->GetProfile()->GetPrefs());
// base::Unretained is safe since the side panel must be attached to some
@@ -244,10 +231,6 @@
base::BindRepeating(&BrowserView::UpdateSidePanelHorizontalAlignment,
base::Unretained(browser_view)));
- animation_.SetTweenType(gfx::Tween::Type::EASE_IN_OUT);
-
- animation_.SetSlideDuration(base::Milliseconds(kAnimationDurationMs));
-
SetVisible(false);
SetLayoutManager(std::make_unique<views::FillLayout>());
@@ -258,9 +241,13 @@
SetBorder(views::CreateEmptyBorder(kBorderInsets));
SetProperty(views::kElementIdentifierKey, kSidePanelElementId);
+
+ AddObserver(this);
}
-SidePanel::~SidePanel() = default;
+SidePanel::~SidePanel() {
+ RemoveObserver(this);
+}
void SidePanel::SetPanelWidth(int width) {
// Only the width is used by BrowserViewLayout.
@@ -297,10 +284,6 @@
min_height);
}
-bool SidePanel::IsClosing() {
- return animation_.IsClosing();
-}
-
void SidePanel::AddHeaderView(std::unique_ptr<views::View> view) {
// If a header view already exists make sure we remove it so that it is
// replaced.
@@ -333,22 +316,7 @@
UpdateVisibility();
}
-double SidePanel::GetAnimationValue() const {
- if (lens::features::IsLensOverlayEnabled()) {
- return animation_.GetCurrentValue();
- } else {
- return 1;
- }
-}
-
void SidePanel::OnChildViewAdded(View* observed_view, View* child) {
- if (observed_view != this || child == border_view_ || child == resize_area_) {
- return;
- }
- if (child != header_view_) {
- content_view_observations_.AddObservation(child);
- }
-
UpdateVisibility();
// Reorder `border_view_` to be last so that it gets painted on top, even if
// an added child also paints to a layer.
@@ -374,37 +342,9 @@
}
void SidePanel::OnChildViewRemoved(View* observed_view, View* child) {
- if (observed_view != this) {
- return;
- }
- if (content_view_observations_.IsObservingSource(child)) {
- content_view_observations_.RemoveObservation(child);
- }
UpdateVisibility();
}
-void SidePanel::OnViewPropertyChanged(View* observed_view,
- const void* key,
- int64_t old_value) {
- if (key == kSidePanelContentStateKey &&
- static_cast<SidePanelContentState>(
- observed_view->GetProperty(kSidePanelContentStateKey)) !=
- static_cast<SidePanelContentState>(old_value)) {
- UpdateVisibility();
- }
-}
-
-void SidePanel::AnimationProgressed(const gfx::Animation* animation) {
- InvalidateLayout();
-}
-
-void SidePanel::AnimationEnded(const gfx::Animation* animation) {
- if (animation->GetCurrentValue() == 0) {
- SetVisible(false);
- }
- InvalidateLayout();
-}
-
void SidePanel::OnResize(int resize_amount, bool done_resizing) {
if (starting_width_on_resize_ < 0) {
starting_width_on_resize_ = width();
@@ -442,26 +382,17 @@
}
void SidePanel::UpdateVisibility() {
- bool should_be_open = false;
- std::vector<views::View*> views_to_hide;
+ bool any_child_visible = false;
// TODO(pbos): Iterate content instead. Requires moving the owned pointer out
// of owned contents before resetting it.
- for (views::View* view : children()) {
+ for (const views::View* view : children()) {
if (view == border_view_ || view == resize_area_ || view == header_view_) {
continue;
}
- if (view->GetVisible() &&
- static_cast<SidePanelContentState>(
- view->GetProperty(kSidePanelContentStateKey)) ==
- SidePanelContentState::kReadyToHide) {
- views_to_hide.push_back(view);
- }
- if (view->GetVisible() &&
- static_cast<SidePanelContentState>(
- view->GetProperty(kSidePanelContentStateKey)) ==
- SidePanelContentState::kReadyToShow) {
- should_be_open = true;
+ if (view->GetVisible()) {
+ any_child_visible = true;
+ break;
}
}
// Make sure the border visibility matches the side panel. Also dynamically
@@ -470,10 +401,9 @@
// https://crbug.com/1269090.
// TODO(pbos): Should layer visibility/painting be automatically tied to
// parent visibility? I.e. the difference between GetVisible() and IsDrawn().
- bool side_panel_open_or_closing = GetVisible() || should_be_open;
- if (side_panel_open_or_closing != border_view_->GetVisible()) {
- border_view_->SetVisible(side_panel_open_or_closing);
- if (side_panel_open_or_closing) {
+ if (any_child_visible != border_view_->GetVisible()) {
+ border_view_->SetVisible(any_child_visible);
+ if (any_child_visible) {
border_view_->SetPaintToLayer();
border_view_->layer()->SetFillsBoundsOpaquely(false);
if (header_view_) {
@@ -489,24 +419,7 @@
border_view_->DestroyLayer();
}
}
- if (lens::features::IsLensOverlayEnabled() &&
- gfx::Animation::ShouldRenderRichAnimation() && !animations_disabled_) {
- if (should_be_open) {
- // If the side panel should remain open but there are views to hide, hide
- // them immediately.
- for (auto* view : views_to_hide) {
- view->SetVisible(false);
- }
- SetVisible(should_be_open);
- animation_.Show();
- } else {
- if (GetVisible() && !IsClosing()) {
- animation_.Hide();
- }
- }
- } else {
- SetVisible(should_be_open);
- }
+ SetVisible(any_child_visible);
}
BEGIN_METADATA(SidePanel)
diff --git a/chrome/browser/ui/views/side_panel/side_panel.h b/chrome/browser/ui/views/side_panel/side_panel.h
index 43e99ec4e..b56a4e2 100644
--- a/chrome/browser/ui/views/side_panel/side_panel.h
+++ b/chrome/browser/ui/views/side_panel/side_panel.h
@@ -8,20 +8,18 @@
#include <memory>
#include "base/memory/raw_ptr.h"
-#include "base/scoped_multi_source_observation.h"
#include "components/prefs/pref_change_registrar.h"
#include "ui/base/metadata/metadata_header_macros.h"
-#include "ui/gfx/animation/slide_animation.h"
#include "ui/gfx/geometry/rounded_corners_f.h"
#include "ui/views/accessible_pane_view.h"
-#include "ui/views/animation/animation_delegate_views.h"
#include "ui/views/controls/resize_area_delegate.h"
+#include "ui/views/view_observer.h"
class BrowserView;
class SidePanel : public views::AccessiblePaneView,
- public views::ResizeAreaDelegate,
- public views::AnimationDelegateViews {
+ public views::ViewObserver,
+ public views::ResizeAreaDelegate {
METADATA_HEADER(SidePanel, views::AccessiblePaneView)
public:
@@ -38,15 +36,12 @@
~SidePanel() override;
void SetPanelWidth(int width);
- double GetAnimationValue() const;
gfx::RoundedCornersF background_radii() const { return background_radii_; }
void SetBackgroundRadii(const gfx::RoundedCornersF& radii);
void SetHorizontalAlignment(HorizontalAlignment alignment);
HorizontalAlignment GetHorizontalAlignment();
bool IsRightAligned();
gfx::Size GetMinimumSize() const override;
- bool IsClosing();
- void DisableAnimationsForTesting() { animations_disabled_ = true; }
// Add a header view that gets painted over the side panel border. The top
// border area grows to accommodate the additional height of the header,
@@ -76,17 +71,11 @@
// views::ViewObserver:
void OnChildViewAdded(View* observed_view, View* child) override;
void OnChildViewRemoved(View* observed_view, View* child) override;
- void OnViewPropertyChanged(View* observed_view,
- const void* key,
- int64_t old_value) override;
- // views::AnimationDelegateViews:
- void AnimationProgressed(const gfx::Animation* animation) override;
- void AnimationEnded(const gfx::Animation* animation) override;
-
- raw_ptr<View> border_view_ = nullptr;
+ const raw_ptr<View> border_view_;
const raw_ptr<BrowserView> browser_view_;
- raw_ptr<View> resize_area_ = nullptr;
+ const raw_ptr<View> resize_area_;
+
raw_ptr<views::View> header_view_ = nullptr;
// -1 if a side panel resize is not in progress, otherwise the width of the
@@ -97,15 +86,6 @@
// logged.
bool did_resize_ = false;
- bool animations_disabled_ = false;
-
- // Animation controlling showing and hiding of the side panel.
- gfx::SlideAnimation animation_{this};
- // Monitors content views so we will be notified if their property
- // state changes.
- base::ScopedMultiSourceObservation<View, ViewObserver>
- content_view_observations_{this};
-
gfx::RoundedCornersF background_radii_;
// Keeps track of the side the side panel will appear on (left or right).
diff --git a/chrome/browser/ui/views/side_panel/side_panel_coordinator.cc b/chrome/browser/ui/views/side_panel/side_panel_coordinator.cc
index 45e67fc..ef35c02 100644
--- a/chrome/browser/ui/views/side_panel/side_panel_coordinator.cc
+++ b/chrome/browser/ui/views/side_panel/side_panel_coordinator.cc
@@ -43,7 +43,6 @@
#include "chrome/grit/generated_resources.h"
#include "components/feature_engagement/public/event_constants.h"
#include "components/feature_engagement/public/feature_constants.h"
-#include "components/lens/lens_features.h"
#include "components/strings/grit/components_strings.h"
#include "ui/actions/action_id.h"
#include "ui/base/interaction/element_tracker.h"
@@ -253,10 +252,6 @@
loading_entry_ = nullptr;
}
- void SetNoDelaysForTesting(bool no_delays_for_testing) {
- show_immediately_for_testing_ = no_delays_for_testing;
- }
-
SidePanelEntry* loading_entry() const { return loading_entry_; }
private:
@@ -394,21 +389,66 @@
}
void SidePanelCoordinator::Close() {
- if (!IsSidePanelShowing() ||
- browser_view_->unified_side_panel()->IsClosing()) {
+ if (!GetContentContainerView()) {
return;
}
+
+ bool closing_global = false;
+ if (current_entry_) {
+ // Reset current_entry_ first to prevent current_entry->OnEntryHidden() from
+ // calling multiple times. This could happen in the edge cases when callback
+ // inside current_entry->OnEntryHidden() is calling Close() to trigger race
+ // condition.
+ auto* current_entry = current_entry_.get();
+ if (global_registry_->GetEntryForKey(current_entry->key()) ==
+ current_entry) {
+ closing_global = true;
+ }
+ current_entry_.reset();
+ if (browser_view_->toolbar()->pinned_toolbar_actions_container()) {
+ NotifyPinnedContainerOfActiveStateChange(current_entry->key(), false);
+ }
+ current_entry->OnEntryHidden();
+ }
+
+ // Reset active entry values for all observed registries and clear cache for
+ // everything except remaining active entries (i.e. if another tab has an
+ // active contextual entry).
+ if (auto* contextual_registry = GetActiveContextualRegistry()) {
+ contextual_registry->ResetActiveEntry();
+ if (closing_global) {
+ // Reset last active entry in contextual registry as global entry should
+ // take precedence.
+ contextual_registry->ResetLastActiveEntry();
+ }
+ }
+ global_registry_->ResetActiveEntry();
+ ClearCachedEntryViews();
+
+ // TODO(pbos): Make this button observe panel-visibility state instead.
+ if (!companion::IsCompanionFeatureEnabled()) {
+ SetSidePanelButtonTooltipText(
+ l10n_util::GetStringUTF16(IDS_TOOLTIP_SIDE_PANEL_SHOW));
+ }
+
+ // `OnEntryWillDeregister` (triggered by calling `OnEntryHidden`) may already
+ // have deleted the content container, so check that it still exists.
if (views::View* content_container = GetContentContainerView()) {
- content_container->SetProperty(
- kSidePanelContentStateKey,
- static_cast<std::underlying_type_t<SidePanelContentState>>(
- SidePanelContentState::kReadyToHide));
+ browser_view_->unified_side_panel()->RemoveChildViewT(content_container);
+ }
+ if (!features::IsChromeRefresh2023()) {
+ header_combobox_ = nullptr;
+ }
+ SidePanelUtil::RecordSidePanelClosed(opened_timestamp_);
+
+ for (SidePanelViewStateObserver& view_state_observer :
+ view_state_observers_) {
+ view_state_observer.OnSidePanelDidClose();
}
}
void SidePanelCoordinator::Toggle() {
- if (IsSidePanelShowing() &&
- !browser_view_->unified_side_panel()->IsClosing()) {
+ if (IsSidePanelShowing()) {
Close();
} else {
std::optional<SidePanelEntry::Id> entry_id = std::nullopt;
@@ -425,8 +465,7 @@
SidePanelUtil::SidePanelOpenTrigger open_trigger) {
// If an entry is already showing in the sidepanel, the sidepanel
// should be closed.
- if (IsSidePanelEntryShowing(key) &&
- !browser_view_->unified_side_panel()->IsClosing()) {
+ if (IsSidePanelEntryShowing(key)) {
Close();
return;
}
@@ -535,10 +574,7 @@
}
bool SidePanelCoordinator::IsSidePanelShowing() const {
- if (auto* side_panel = browser_view_->unified_side_panel()) {
- return side_panel->GetVisible();
- }
- return false;
+ return GetContentContainerView() != nullptr;
}
bool SidePanelCoordinator::IsSidePanelEntryShowing(
@@ -561,11 +597,6 @@
return nullptr;
}
-void SidePanelCoordinator::DisableAnimationsForTesting() {
- browser_view_->unified_side_panel()
- ->DisableAnimationsForTesting(); // IN-TEST
-}
-
SidePanelEntry::Id SidePanelCoordinator::GetComboboxDisplayedEntryIdForTesting()
const {
CHECK(combobox_model_);
@@ -598,9 +629,6 @@
if (GetContentContainerView() == nullptr) {
CHECK(browser_view_->unified_side_panel());
InitializeSidePanel();
- }
-
- if (!IsSidePanelShowing()) {
opened_timestamp_ = base::TimeTicks::Now();
SidePanelUtil::RecordSidePanelOpen(open_trigger);
// Record usage for side panel promo.
@@ -643,10 +671,6 @@
// finished loading. Note, this does not cancel the triggered load of B, B
// remains cached.
if (current_entry_.get() == entry) {
- GetContentContainerView()->SetProperty(
- kSidePanelContentStateKey,
- static_cast<std::underlying_type_t<SidePanelContentState>>(
- SidePanelContentState::kReadyToShow));
if (content_wrapper->loading_entry()) {
content_wrapper->ResetLoadingEntryIfNecessary();
}
@@ -698,7 +722,7 @@
bool SidePanelCoordinator::IsGlobalEntryShowing(
const SidePanelEntry::Key& entry_key) const {
- if (!IsSidePanelShowing() || !current_entry_) {
+ if (!GetContentContainerView() || !current_entry_) {
return false;
}
@@ -766,10 +790,6 @@
content_wrapper->SetVisible(true);
content_container->SetVisible(true);
- content_container->SetProperty(
- kSidePanelContentStateKey,
- static_cast<std::underlying_type_t<SidePanelContentState>>(
- SidePanelContentState::kReadyToShow));
if (current_entry_ && content_wrapper->children().size()) {
auto current_entry_view =
@@ -1087,7 +1107,7 @@
SidePanelEntry* entry) {
if (combobox_model_) {
combobox_model_->AddItem(entry);
- if (IsSidePanelShowing()) {
+ if (GetContentContainerView()) {
SetSelectedEntryInCombobox(GetLastActiveEntryKey().value_or(
SidePanelEntry::Key(GetDefaultEntry())));
}
@@ -1106,7 +1126,7 @@
std::optional<SidePanelEntry::Key> selected_key = GetSelectedKey();
if (ShouldRemoveFromComboboxOnDeregister(registry, entry->key())) {
combobox_model_->RemoveItem(entry->key());
- if (IsSidePanelShowing()) {
+ if (GetContentContainerView()) {
SetSelectedEntryInCombobox(GetLastActiveEntryKey().value_or(
SidePanelEntry::Key(GetDefaultEntry())));
}
@@ -1121,8 +1141,7 @@
// Update the current entry to make sure we don't show an entry that is being
// removed or close the panel if the entry being deregistered is the only one
// that has been visible.
- if (IsSidePanelShowing() &&
- !browser_view_->unified_side_panel()->IsClosing() && current_entry_ &&
+ if (GetContentContainerView() && current_entry_ &&
(current_entry_->key() == entry->key())) {
// If a global entry is deregistered but a contextual entry with the same
// key is shown, do nothing.
@@ -1207,8 +1226,7 @@
// Show an entry in the following fallback order: new contextual registry's
// active entry > active global entry > none (close the side panel).
- if (IsSidePanelShowing() &&
- !browser_view_->unified_side_panel()->IsClosing()) {
+ if (GetContentContainerView()) {
// Attempt to find a suitable entry to be shown after the tab switch and if
// one is found, show it.
if (auto* new_active_entry = GetNewActiveEntryOnTabChanged()) {
@@ -1250,7 +1268,7 @@
}
void SidePanelCoordinator::UpdateHeaderPinButtonState() {
- if (!IsSidePanelShowing() || !current_entry_) {
+ if (!GetContentContainerView() || !current_entry_) {
return;
}
@@ -1301,24 +1319,13 @@
}
}
-void SidePanelCoordinator::SetNoDelaysForTesting(bool no_delays_for_testing) {
- no_delays_for_testing_ = no_delays_for_testing;
- if (auto* content = GetContentContainerView()) {
- static_cast<SidePanelContentSwappingContainer*>(
- content->GetViewByID(kSidePanelContentWrapperViewId))
- ->SetNoDelaysForTesting(no_delays_for_testing_); // IN-TEST
- }
-}
-
void SidePanelCoordinator::UpdateToolbarButtonHighlight(
bool side_panel_visible) {
- if (auto* side_panel_button =
- browser_view_->toolbar()->GetSidePanelButton()) {
- side_panel_button->SetHighlighted(side_panel_visible);
- side_panel_button->SetTooltipText(l10n_util::GetStringUTF16(
- side_panel_visible ? IDS_TOOLTIP_SIDE_PANEL_HIDE
- : IDS_TOOLTIP_SIDE_PANEL_SHOW));
- }
+ auto* side_panel_button = browser_view_->toolbar()->GetSidePanelButton();
+ side_panel_button->SetHighlighted(side_panel_visible);
+ side_panel_button->SetTooltipText(l10n_util::GetStringUTF16(
+ side_panel_visible ? IDS_TOOLTIP_SIDE_PANEL_HIDE
+ : IDS_TOOLTIP_SIDE_PANEL_SHOW));
}
void SidePanelCoordinator::UpdatePanelIconAndTitle(const ui::ImageModel& icon,
@@ -1340,63 +1347,6 @@
void SidePanelCoordinator::OnViewVisibilityChanged(views::View* observed_view,
views::View* starting_from) {
UpdateToolbarButtonHighlight(observed_view->GetVisible());
-
- if (!observed_view->GetVisible()) {
- bool closing_global = false;
- if (current_entry_) {
- // Reset current_entry_ first to prevent current_entry->OnEntryHidden()
- // from calling multiple times. This could happen in the edge cases when
- // callback inside current_entry->OnEntryHidden() is calling Close() to
- // trigger race condition.
- auto* current_entry = current_entry_.get();
- current_entry_.reset();
- if (global_registry_->GetEntryForKey(current_entry->key()) ==
- current_entry) {
- closing_global = true;
- }
- if (browser_view_->toolbar()->pinned_toolbar_actions_container()) {
- NotifyPinnedContainerOfActiveStateChange(current_entry->key(), false);
- }
- current_entry->OnEntryHidden();
- }
-
- // Reset active entry values for all observed registries and clear cache for
- // everything except remaining active entries (i.e. if another tab has an
- // active contextual entry).
- if (auto* contextual_registry = GetActiveContextualRegistry()) {
- contextual_registry->ResetActiveEntry();
- if (closing_global) {
- // Reset last active entry in contextual registry as global entry should
- // take precedence.
- contextual_registry->ResetLastActiveEntry();
- }
- }
- global_registry_->ResetActiveEntry();
- ClearCachedEntryViews();
-
- // TODO(pbos): Make this button observe panel-visibility state instead.
- if (!companion::IsCompanionFeatureEnabled()) {
- SetSidePanelButtonTooltipText(
- l10n_util::GetStringUTF16(IDS_TOOLTIP_SIDE_PANEL_SHOW));
- }
-
- // `OnEntryWillDeregister` (triggered by calling `OnEntryHidden`) may
- // already have deleted the content container, so check that it still
- // exists.
- if (views::View* content_container = GetContentContainerView()) {
- auto* content_wrapper =
- content_container->GetViewByID(kSidePanelContentWrapperViewId);
- if (!content_wrapper->children().empty()) {
- content_wrapper->RemoveChildViewT(content_wrapper->children().front());
- }
- }
- SidePanelUtil::RecordSidePanelClosed(opened_timestamp_);
-
- for (SidePanelViewStateObserver& view_state_observer :
- view_state_observers_) {
- view_state_observer.OnSidePanelDidClose();
- }
- }
}
void SidePanelCoordinator::OnActionsChanged() {
diff --git a/chrome/browser/ui/views/side_panel/side_panel_coordinator.h b/chrome/browser/ui/views/side_panel/side_panel_coordinator.h
index d0dc5a5..8f5d179 100644
--- a/chrome/browser/ui/views/side_panel/side_panel_coordinator.h
+++ b/chrome/browser/ui/views/side_panel/side_panel_coordinator.h
@@ -88,7 +88,6 @@
// Returns the web contents in a side panel if one exists.
content::WebContents* GetWebContentsForTest(SidePanelEntryId id) override;
- void DisableAnimationsForTesting() override;
// TODO(crbug.com/1341399): Move this method to `SidePanelUI` after decoupling
// `SidePanelEntry` from views.
@@ -102,7 +101,9 @@
// Prevent content swapping delays from happening for testing.
// This should be called before the side panel is first shown.
- void SetNoDelaysForTesting(bool no_delays_for_testing);
+ void SetNoDelaysForTesting(bool no_delays_for_testing) {
+ no_delays_for_testing_ = no_delays_for_testing;
+ }
SidePanelEntry* GetCurrentSidePanelEntryForTesting() {
return current_entry_.get();
@@ -141,7 +142,6 @@
void Show(SidePanelEntry* entry,
std::optional<SidePanelUtil::SidePanelOpenTrigger> open_trigger =
std::nullopt);
- void OnClosed();
views::View* GetContentContainerView() const;
diff --git a/chrome/browser/ui/views/side_panel/side_panel_coordinator_unittest.cc b/chrome/browser/ui/views/side_panel/side_panel_coordinator_unittest.cc
index ee5eb6d..8e90b405 100644
--- a/chrome/browser/ui/views/side_panel/side_panel_coordinator_unittest.cc
+++ b/chrome/browser/ui/views/side_panel/side_panel_coordinator_unittest.cc
@@ -472,7 +472,6 @@
coordinator_->Close();
EXPECT_FALSE(browser_view()->unified_side_panel()->GetVisible());
- coordinator_->RemoveSidePanelViewStateObserver(&view_state_observer);
}
TEST_F(SidePanelCoordinatorTest, OpeningSidePanelCallsOnSidePanelObserver) {
diff --git a/chrome/browser/ui/views/side_panel/side_panel_test_utils.cc b/chrome/browser/ui/views/side_panel/side_panel_test_utils.cc
deleted file mode 100644
index 7872f22..0000000
--- a/chrome/browser/ui/views/side_panel/side_panel_test_utils.cc
+++ /dev/null
@@ -1,32 +0,0 @@
-// Copyright 2024 The Chromium Authors
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/ui/views/side_panel/side_panel_test_utils.h"
-
-#include <memory>
-
-#include "base/run_loop.h"
-#include "chrome/browser/ui/views/side_panel/side_panel_coordinator.h"
-
-SidePanelWaiter::SidePanelWaiter(SidePanelCoordinator* side_panel_coordinator)
- : side_panel_coordinator_(side_panel_coordinator) {
- side_panel_coordinator->AddSidePanelViewStateObserver(this);
-}
-
-SidePanelWaiter::~SidePanelWaiter() {
- side_panel_coordinator_->RemoveSidePanelViewStateObserver(this);
-}
-
-void SidePanelWaiter::WaitForSidePanelClose() {
- if (side_panel_coordinator_->IsSidePanelShowing()) {
- side_panel_close_run_loop_ = std::make_unique<base::RunLoop>();
- side_panel_close_run_loop_->Run();
- }
-}
-
-void SidePanelWaiter::OnSidePanelDidClose() {
- if (side_panel_close_run_loop_ && side_panel_close_run_loop_->running()) {
- side_panel_close_run_loop_->Quit();
- }
-}
diff --git a/chrome/browser/ui/views/side_panel/side_panel_test_utils.h b/chrome/browser/ui/views/side_panel/side_panel_test_utils.h
deleted file mode 100644
index b15ab4f..0000000
--- a/chrome/browser/ui/views/side_panel/side_panel_test_utils.h
+++ /dev/null
@@ -1,33 +0,0 @@
-// Copyright 2024 The Chromium Authors
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROME_BROWSER_UI_VIEWS_SIDE_PANEL_SIDE_PANEL_TEST_UTILS_H_
-#define CHROME_BROWSER_UI_VIEWS_SIDE_PANEL_SIDE_PANEL_TEST_UTILS_H_
-
-#include <memory>
-
-#include "base/memory/raw_ptr.h"
-#include "base/run_loop.h"
-#include "chrome/browser/ui/views/side_panel/side_panel_coordinator.h"
-#include "chrome/browser/ui/views/side_panel/side_panel_view_state_observer.h"
-
-// A class which waits on various SidePanelEntryObserver events.
-class SidePanelWaiter : public SidePanelViewStateObserver {
- public:
- explicit SidePanelWaiter(SidePanelCoordinator* side_panel_coordinator);
-
- ~SidePanelWaiter() override;
- SidePanelWaiter(const SidePanelWaiter& other) = delete;
- SidePanelWaiter& operator=(const SidePanelWaiter& other) = delete;
-
- void WaitForSidePanelClose();
-
- private:
- void OnSidePanelDidClose() override;
-
- raw_ptr<SidePanelCoordinator> side_panel_coordinator_;
- std::unique_ptr<base::RunLoop> side_panel_close_run_loop_;
-};
-
-#endif // CHROME_BROWSER_UI_VIEWS_SIDE_PANEL_SIDE_PANEL_TEST_UTILS_H_
diff --git a/chrome/browser/ui/views/side_panel/side_panel_util.cc b/chrome/browser/ui/views/side_panel/side_panel_util.cc
index d50dc74..a2d54a4 100644
--- a/chrome/browser/ui/views/side_panel/side_panel_util.cc
+++ b/chrome/browser/ui/views/side_panel/side_panel_util.cc
@@ -49,12 +49,6 @@
kSidePanelOpenTriggerKey,
kInvalidSidePanelOpenTrigger)
-DEFINE_UI_CLASS_PROPERTY_TYPE(SidePanelContentState)
-DEFINE_UI_CLASS_PROPERTY_KEY(std::underlying_type_t<SidePanelContentState>,
- kSidePanelContentStateKey,
- std::underlying_type_t<SidePanelContentState>(
- SidePanelContentState::kReadyToShow))
-
// static
void SidePanelUtil::PopulateGlobalEntries(Browser* browser,
SidePanelRegistry* global_registry) {
diff --git a/chrome/browser/ui/views/side_panel/side_panel_util.h b/chrome/browser/ui/views/side_panel/side_panel_util.h
index 42b97c9e..b08a05c 100644
--- a/chrome/browser/ui/views/side_panel/side_panel_util.h
+++ b/chrome/browser/ui/views/side_panel/side_panel_util.h
@@ -13,7 +13,6 @@
#include "chrome/browser/ui/side_panel/side_panel_enums.h"
#include "chrome/browser/ui/views/side_panel/side_panel_entry.h"
#include "ui/actions/actions.h"
-#include "ui/base/class_property.h"
class Browser;
class SidePanelRegistry;
@@ -27,7 +26,6 @@
class SidePanelUtil {
public:
using SidePanelOpenTrigger = ::SidePanelOpenTrigger;
- using SidePanelContentState = ::SidePanelContentState;
static void PopulateGlobalEntries(Browser* browser,
SidePanelRegistry* global_registry);
@@ -73,8 +71,4 @@
std::underlying_type_t<SidePanelOpenTrigger>>* const
kSidePanelOpenTriggerKey;
-extern const ui::ClassProperty<
- std::underlying_type_t<SidePanelContentState>>* const
- kSidePanelContentStateKey;
-
#endif // CHROME_BROWSER_UI_VIEWS_SIDE_PANEL_SIDE_PANEL_UTIL_H_
diff --git a/chrome/browser/ui/views/toolbar/toolbar_controller_interactive_uitest.cc b/chrome/browser/ui/views/toolbar/toolbar_controller_interactive_uitest.cc
index 0417e77a..a730cbd 100644
--- a/chrome/browser/ui/views/toolbar/toolbar_controller_interactive_uitest.cc
+++ b/chrome/browser/ui/views/toolbar/toolbar_controller_interactive_uitest.cc
@@ -256,8 +256,7 @@
}),
WaitForShow(kSidePanelElementId), FlushEvents(),
PressButton(kSidePanelPinButtonElementId),
- PressButton(kSidePanelCloseButtonElementId),
- WaitForHide(kSidePanelElementId), FlushEvents());
+ PressButton(kSidePanelCloseButtonElementId));
}
auto PinReadingModeToToolbar() {
diff --git a/chrome/browser/ui/webui/side_panel/customize_chrome/customize_chrome_browsertest.cc b/chrome/browser/ui/webui/side_panel/customize_chrome/customize_chrome_browsertest.cc
index eddfd4d9..2a56a4cd 100644
--- a/chrome/browser/ui/webui/side_panel/customize_chrome/customize_chrome_browsertest.cc
+++ b/chrome/browser/ui/webui/side_panel/customize_chrome/customize_chrome_browsertest.cc
@@ -7,7 +7,6 @@
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_tabstrip.h"
#include "chrome/browser/ui/side_panel/customize_chrome/customize_chrome_tab_helper.h"
-#include "chrome/browser/ui/side_panel/side_panel_ui.h"
#include "chrome/browser/ui/webui/side_panel/customize_chrome/customize_chrome_section.h"
#include "chrome/common/webui_url_constants.h"
#include "chrome/test/base/in_process_browser_test.h"
@@ -89,8 +88,6 @@
IN_PROC_BROWSER_TEST_F(CustomizeChromeSidePanelBrowserTest,
ContextualCustomizeChromeSidePanel) {
- SidePanelUI::GetSidePanelUIForBrowser(browser())
- ->DisableAnimationsForTesting();
// The Customize Chrome side panel should be contextual, opening on one tab
// should not open it on other tabs.
AppendTab(browser(), GURL(chrome::kChromeUINewTabURL));
@@ -112,8 +109,6 @@
IN_PROC_BROWSER_TEST_F(CustomizeChromeSidePanelBrowserTest,
HideCustomizeChromeSidePanel) {
- SidePanelUI::GetSidePanelUIForBrowser(browser())
- ->DisableAnimationsForTesting();
auto* customize_chrome_tab_helper = GetTabHelper(browser());
ASSERT_TRUE(ui_test_utils::NavigateToURL(browser(),
GURL(chrome::kChromeUINewTabURL)));
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn
index f2944b4..111d8ca 100644
--- a/chrome/test/BUILD.gn
+++ b/chrome/test/BUILD.gn
@@ -10355,8 +10355,6 @@
"../browser/ui/views/autofill/popup/popup_view_views_test_api.h",
"../browser/ui/views/create_application_shortcut_view_test_support.cc",
"../browser/ui/views/create_application_shortcut_view_test_support.h",
- "../browser/ui/views/side_panel/side_panel_test_utils.cc",
- "../browser/ui/views/side_panel/side_panel_test_utils.h",
"../browser/ui/views/tabs/tab_hover_card_test_util.cc",
"../browser/ui/views/tabs/tab_hover_card_test_util.h",
"../browser/ui/views/web_apps/web_app_integration_test_driver.cc",
diff --git a/tools/metrics/histograms/enums.xml b/tools/metrics/histograms/enums.xml
index 57cbdd0b..8ec19b30 100644
--- a/tools/metrics/histograms/enums.xml
+++ b/tools/metrics/histograms/enums.xml
@@ -32205,7 +32205,6 @@
<int value="15" label="Opened from Read Anything omnibox icon"/>
<int value="16" label="Opened from Read Anything via address bar"/>
<int value="17" label="Opened from toolbar overflow menu"/>
- <int value="18" label="Opened from an extension"/>
</enum>
<enum name="SideSearchAvailabilityChangeType">