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

Unified Diff: chrome/browser/ui/ash/launcher/browser_shortcut_launcher_item_controller.h

Issue 2793443003: Removed NOTIFICATION_BROWSER_CLOSING notification (Closed)
Patch Set: Update CL basing on review comments (rebase) Created 3 years, 7 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/ash/launcher/browser_shortcut_launcher_item_controller.h
diff --git a/chrome/browser/ui/ash/launcher/browser_shortcut_launcher_item_controller.h b/chrome/browser/ui/ash/launcher/browser_shortcut_launcher_item_controller.h
index 0fca4e3a756e1b5c3af3ee9533faa073c9bc73fb..0a9d4fc847b516672b301379da0ebd8cf28c15ba 100644
--- a/chrome/browser/ui/ash/launcher/browser_shortcut_launcher_item_controller.h
+++ b/chrome/browser/ui/ash/launcher/browser_shortcut_launcher_item_controller.h
@@ -7,9 +7,9 @@
#include "ash/public/cpp/shelf_item_delegate.h"
#include "base/macros.h"
+#include "base/scoped_observer.h"
#include "chrome/browser/ui/browser_list.h"
-#include "content/public/browser/notification_observer.h"
-#include "content/public/browser/notification_registrar.h"
+#include "chrome/browser/ui/browser_list_observer.h"
namespace ash {
class ShelfModel;
@@ -23,7 +23,7 @@ class WebContents;
// This item shows an application menu that lists open browser windows or tabs.
class BrowserShortcutLauncherItemController
: public ash::ShelfItemDelegate,
- public content::NotificationObserver {
+ public chrome::BrowserListObserver {
public:
explicit BrowserShortcutLauncherItemController(ash::ShelfModel* shelf_model);
@@ -61,18 +61,16 @@ class BrowserShortcutLauncherItemController
// Get a list of active browsers.
BrowserList::BrowserVector GetListOfActiveBrowsers();
- // content::NotificationObserver:
- void Observe(int type,
- const content::NotificationSource& source,
- const content::NotificationDetails& details) override;
+ // chrome::BrowserListObserver:
+ void OnBrowserClosing(Browser* browser) override;
ash::ShelfModel* shelf_model_;
// The cached list of open browser windows shown in an application menu.
BrowserList::BrowserVector browser_menu_items_;
- // Registers for notifications of closing browser windows.
- content::NotificationRegistrar registrar_;
+ // Observer for browser windows closing events.
+ ScopedObserver<BrowserList, BrowserListObserver> browser_list_observer_;
DISALLOW_COPY_AND_ASSIGN(BrowserShortcutLauncherItemController);
};

Powered by Google App Engine
This is Rietveld 408576698