Index: chrome/browser/ui/toolbar/toolbar_actions_bar.cc |
diff --git a/chrome/browser/ui/toolbar/toolbar_actions_bar.cc b/chrome/browser/ui/toolbar/toolbar_actions_bar.cc |
index e6cb99cc83c5e8c47edf832bc6113f86a75cc7e7..b5c89490839eb49b9bd737e24373b49063bbe4a4 100644 |
--- a/chrome/browser/ui/toolbar/toolbar_actions_bar.cc |
+++ b/chrome/browser/ui/toolbar/toolbar_actions_bar.cc |
@@ -124,6 +124,7 @@ ToolbarActionsBar::ToolbarActionsBar(ToolbarActionsBarDelegate* delegate, |
main_bar_(main_bar), |
platform_settings_(main_bar != nullptr), |
popup_owner_(nullptr), |
+ sidebar_owner_(nullptr), |
model_observer_(this), |
suppress_layout_(false), |
suppress_animation_(true), |
@@ -512,6 +513,21 @@ void ToolbarActionsBar::HideActivePopup() { |
DCHECK(!popup_owner_); |
} |
+void ToolbarActionsBar::SetSidebarOwner( |
+ ToolbarActionViewController* sidebar_owner) { |
+ // We should never be setting a popup owner when one already exists, and |
+ // never unsetting one when one wasn't set. |
+ DCHECK((!sidebar_owner_ && sidebar_owner) || |
+ (sidebar_owner_ && !sidebar_owner)); |
+ sidebar_owner_ = sidebar_owner; |
+} |
+ |
+void ToolbarActionsBar::HideActiveSidebar() { |
+ if (sidebar_owner_) |
+ sidebar_owner_->HideSidebar(); |
+ DCHECK(!sidebar_owner_); |
+} |
+ |
ToolbarActionViewController* ToolbarActionsBar::GetMainControllerForAction( |
ToolbarActionViewController* action) { |
return in_overflow_mode() ? |