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

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

Issue 399143004: Open the WrenchMenu on mouseover when dragging a browser action (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 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/toolbar/wrench_menu_model.cc
diff --git a/chrome/browser/ui/toolbar/wrench_menu_model.cc b/chrome/browser/ui/toolbar/wrench_menu_model.cc
index 864874379c2b6f7ff26e967e98516f28448330f4..5849c643b4f3bf0fc51774fd6c7acce47396d887 100644
--- a/chrome/browser/ui/toolbar/wrench_menu_model.cc
+++ b/chrome/browser/ui/toolbar/wrench_menu_model.cc
@@ -15,6 +15,7 @@
#include "chrome/app/chrome_command_ids.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/defaults.h"
+#include "chrome/browser/extensions/extension_toolbar_model.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/search/search.h"
@@ -741,8 +742,12 @@ void WrenchMenuModel::AddGlobalErrorMenuItems() {
void WrenchMenuModel::CreateExtensionToolbarOverflowMenu() {
#if defined(TOOLKIT_VIEWS)
AddItem(IDC_EXTENSIONS_OVERFLOW_MENU, base::string16());
- // TODO(devlin): Add the separator only if there are > 0 icons to show.
- AddSeparator(ui::UPPER_SEPARATOR);
+ // We only add the separator if there are > 0 items to show in the overflow.
+ extensions::ExtensionToolbarModel* toolbar_model =
+ extensions::ExtensionToolbarModel::Get(browser_->profile());
+ // A count of -1 means all actions are visible.
+ if (toolbar_model->GetVisibleIconCount() != -1)
+ AddSeparator(ui::UPPER_SEPARATOR);
#endif // defined(TOOLKIT_VIEWS)
}

Powered by Google App Engine
This is Rietveld 408576698