Chromium Code Reviews| 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) |
|
Finnur
2014/07/18 10:40:39
Hah... somehow I thought this would be more compli
Devlin
2014/07/18 15:44:32
I'm pretty sure that we *should* add this if the c
Finnur
2014/07/18 15:53:51
Ah, yes.
|
| + AddSeparator(ui::UPPER_SEPARATOR); |
| #endif // defined(TOOLKIT_VIEWS) |
| } |