Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1292)

Unified Diff: chrome/browser/ui/toolbar/toolbar_actions_bar.cc

Issue 1168383002: Implement sidebar support for extension action popups Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix assertion failure at extension_view_host.cc Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/toolbar/toolbar_actions_bar.h ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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() ?
« no previous file with comments | « chrome/browser/ui/toolbar/toolbar_actions_bar.h ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698