| Index: chrome/browser/ui/views/wrench_menu.cc
|
| ===================================================================
|
| --- chrome/browser/ui/views/wrench_menu.cc (revision 104036)
|
| +++ chrome/browser/ui/views/wrench_menu.cc (working copy)
|
| @@ -14,6 +14,7 @@
|
| #include "chrome/browser/ui/browser.h"
|
| #include "chrome/browser/ui/browser_window.h"
|
| #include "chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.h"
|
| +#include "chrome/common/chrome_notification_types.h"
|
| #include "content/browser/tab_contents/tab_contents.h"
|
| #include "content/browser/user_metrics.h"
|
| #include "content/common/content_notification_types.h"
|
| @@ -568,6 +569,8 @@
|
| selected_index_(0),
|
| bookmark_menu_(NULL),
|
| first_bookmark_command_id_(0) {
|
| + registrar_.Add(this, chrome::NOTIFICATION_GLOBAL_ERRORS_CHANGED,
|
| + Source<Profile>(browser_->profile()));
|
| }
|
|
|
| WrenchMenu::~WrenchMenu() {
|
| @@ -769,6 +772,21 @@
|
| root_->Cancel();
|
| }
|
|
|
| +
|
| +void WrenchMenu::Observe(int type,
|
| + const NotificationSource& source,
|
| + const NotificationDetails& details) {
|
| + switch (type) {
|
| + case chrome::NOTIFICATION_GLOBAL_ERRORS_CHANGED:
|
| + // A change in the global errors list can add or remove items from the
|
| + // menu. Close the menu to avoid have a stale menu on-screen.
|
| + root_->Cancel();
|
| + break;
|
| + default:
|
| + NOTREACHED();
|
| + }
|
| +}
|
| +
|
| void WrenchMenu::PopulateMenu(MenuItemView* parent,
|
| MenuModel* model,
|
| int* next_id) {
|
|
|