| 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 8d99edece1ef9ec0926abdd3599f2312f8e40385..c9f2b8987a7b3d36c49b3e2e36d0fa2e01d1c5d6 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"
|
| @@ -740,8 +741,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)
|
| }
|
|
|
|
|