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

Unified Diff: chrome/browser/ui/views/toolbar/toolbar_action_view.cc

Issue 869873008: [Extensions Toolbar] Move some popup logic to be platform-agnostic (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Avi's Created 5 years, 11 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
Index: chrome/browser/ui/views/toolbar/toolbar_action_view.cc
diff --git a/chrome/browser/ui/views/toolbar/toolbar_action_view.cc b/chrome/browser/ui/views/toolbar/toolbar_action_view.cc
index 7ee1abb6a7e42d30adf20d325cb6540a5c24a303..fcc647690c6b609423194de1dcdab4fd99a8795c 100644
--- a/chrome/browser/ui/views/toolbar/toolbar_action_view.cc
+++ b/chrome/browser/ui/views/toolbar/toolbar_action_view.cc
@@ -281,14 +281,10 @@ content::WebContents* ToolbarActionView::GetCurrentWebContents() const {
return delegate_->GetCurrentWebContents();
}
-void ToolbarActionView::HideActivePopup() {
- delegate_->HideActivePopup();
-}
-
-void ToolbarActionView::OnPopupShown(bool grant_tab_permissions) {
+void ToolbarActionView::OnPopupShown(bool by_user) {
delegate_->SetPopupOwner(this);
// If this was through direct user action, we press the menu button.
- if (grant_tab_permissions) {
+ if (by_user) {
// We set the state of the menu button we're using as a reference view,
// which is either this or the overflow reference view.
// This cast is safe because GetReferenceViewForPopup returns either |this|
@@ -299,11 +295,7 @@ void ToolbarActionView::OnPopupShown(bool grant_tab_permissions) {
}
}
-void ToolbarActionView::CleanupPopup() {
- // We need to do these actions synchronously (instead of closing and then
- // performing the rest of the cleanup in OnWidgetDestroyed()) because
- // OnWidgetDestroyed() can be called asynchronously from Close(), and we need
- // to keep the delegate's popup owner up-to-date.
- delegate_->SetPopupOwner(NULL);
+void ToolbarActionView::OnPopupClosed() {
+ delegate_->SetPopupOwner(nullptr);
pressed_lock_.reset(); // Unpress the menu button if it was pressed.
}

Powered by Google App Engine
This is Rietveld 408576698