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

Unified Diff: chrome/browser/extensions/extension_toolbar_model.cc

Issue 489183005: Make a ShowExtensionActionPopup function (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Peter's Created 6 years, 4 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/extensions/extension_toolbar_model.cc
diff --git a/chrome/browser/extensions/extension_toolbar_model.cc b/chrome/browser/extensions/extension_toolbar_model.cc
index 35e51b203bb6efab24ed1aa4c5154f1966f50042..185860345a22d0d1dbcf7e4c7ca0e4f48aebe332 100644
--- a/chrome/browser/extensions/extension_toolbar_model.cc
+++ b/chrome/browser/extensions/extension_toolbar_model.cc
@@ -569,13 +569,18 @@ void ExtensionToolbarModel::OnExtensionToolbarPrefChange() {
}
}
-bool ExtensionToolbarModel::ShowBrowserActionPopup(const Extension* extension) {
+bool ExtensionToolbarModel::ShowExtensionActionPopup(
+ const Extension* extension,
+ Browser* browser,
+ bool grant_active_tab) {
ObserverListBase<Observer>::Iterator it(observers_);
Observer* obs = NULL;
+ // Look for the Observer associated with the browser.
+ // This would be cleaner if we had an abstract class for the Toolbar UI
+ // (like we do for LocationBar), but sadly, we don't.
while ((obs = it.GetNext()) != NULL) {
- // Stop after first popup since it should only show in the active window.
- if (obs->ShowExtensionActionPopup(extension))
- return true;
+ if (obs->GetBrowser() == browser)
+ return obs->ShowExtensionActionPopup(extension, grant_active_tab);
}
return false;
}
« no previous file with comments | « chrome/browser/extensions/extension_toolbar_model.h ('k') | chrome/browser/extensions/extension_toolbar_model_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698