| Index: chrome/browser/ui/views/frame/global_menu_bar_x11.cc
|
| diff --git a/chrome/browser/ui/views/frame/global_menu_bar_x11.cc b/chrome/browser/ui/views/frame/global_menu_bar_x11.cc
|
| index a19b2c3aba8f64d1b7c0c390bdb482a92e3ddea5..69606c60b9d9302046844c6e0d346592e2736fba 100644
|
| --- a/chrome/browser/ui/views/frame/global_menu_bar_x11.cc
|
| +++ b/chrome/browser/ui/views/frame/global_menu_bar_x11.cc
|
| @@ -16,7 +16,6 @@
|
| #include "base/strings/utf_string_conversions.h"
|
| #include "chrome/app/chrome_command_ids.h"
|
| #include "chrome/browser/browser_process.h"
|
| -#include "chrome/browser/chrome_notification_types.h"
|
| #include "chrome/browser/history/top_sites.h"
|
| #include "chrome/browser/profiles/profile.h"
|
| #include "chrome/browser/profiles/profile_info_cache.h"
|
| @@ -32,7 +31,6 @@
|
| #include "chrome/browser/ui/views/frame/global_menu_bar_registrar_x11.h"
|
| #include "chrome/common/pref_names.h"
|
| #include "chrome/grit/generated_resources.h"
|
| -#include "content/public/browser/notification_source.h"
|
| #include "ui/base/accelerators/menu_label_accelerator_util_linux.h"
|
| #include "ui/base/l10n/l10n_util.h"
|
| #include "ui/events/keycodes/keyboard_code_conversion_x.h"
|
| @@ -334,6 +332,7 @@ GlobalMenuBarX11::GlobalMenuBarX11(BrowserView* browser_view,
|
| profiles_menu_(nullptr),
|
| top_sites_(nullptr),
|
| tab_restore_service_(nullptr),
|
| + scoped_observer_(this),
|
| weak_ptr_factory_(this) {
|
| EnsureMethodsLoaded();
|
|
|
| @@ -430,10 +429,9 @@ void GlobalMenuBarX11::InitServer(unsigned long xid) {
|
| if (top_sites_) {
|
| GetTopSitesData();
|
|
|
| - // Register for notification when TopSites changes so that we can update
|
| - // ourself.
|
| - registrar_.Add(this, chrome::NOTIFICATION_TOP_SITES_CHANGED,
|
| - content::Source<history::TopSites>(top_sites_));
|
| + // Register as TopSitesObserver so that we can update ourselves when the
|
| + // TopSites changes.
|
| + scoped_observer_.Add(top_sites_);
|
| }
|
|
|
| ProfileManager* profile_manager = g_browser_process->profile_manager();
|
| @@ -728,14 +726,11 @@ void GlobalMenuBarX11::EnabledStateChangedForCommand(int id, bool enabled) {
|
| menuitem_property_set_bool(it->second, kPropertyEnabled, enabled);
|
| }
|
|
|
| -void GlobalMenuBarX11::Observe(int type,
|
| - const content::NotificationSource& source,
|
| - const content::NotificationDetails& details) {
|
| - if (type == chrome::NOTIFICATION_TOP_SITES_CHANGED) {
|
| +void GlobalMenuBarX11::TopSitesLoaded(history::TopSites* top_sites) {
|
| +}
|
| +
|
| +void GlobalMenuBarX11::TopSitesChanged(history::TopSites* top_sites) {
|
| GetTopSitesData();
|
| - } else {
|
| - NOTREACHED();
|
| - }
|
| }
|
|
|
| void GlobalMenuBarX11::TabRestoreServiceChanged(TabRestoreService* service) {
|
|
|