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

Unified Diff: chrome/browser/ui/tabs/pinned_tab_service.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/tabs/pinned_tab_service.h
diff --git a/chrome/browser/ui/tabs/pinned_tab_service.h b/chrome/browser/ui/tabs/pinned_tab_service.h
index f1dc573b8cf7e9da006053201dc3da8fdcc26593..d36b640f4392703e26078a91a11b2641d90fc1e4 100644
--- a/chrome/browser/ui/tabs/pinned_tab_service.h
+++ b/chrome/browser/ui/tabs/pinned_tab_service.h
@@ -7,6 +7,9 @@
#include "base/compiler_specific.h"
#include "base/macros.h"
+#include "base/scoped_observer.h"
+#include "chrome/browser/ui/browser_list.h"
+#include "chrome/browser/ui/browser_list_observer.h"
#include "components/keyed_service/core/keyed_service.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
@@ -17,9 +20,11 @@ class Profile;
// pinned tabs to restore at startup. PinnedTabService listens for the
// appropriate set of notifications to know it should update preferences.
class PinnedTabService : public content::NotificationObserver,
+ public chrome::BrowserListObserver,
public KeyedService {
public:
explicit PinnedTabService(Profile* profile);
+ ~PinnedTabService() override;
private:
// content::NotificationObserver.
@@ -27,6 +32,9 @@ class PinnedTabService : public content::NotificationObserver,
const content::NotificationSource& source,
const content::NotificationDetails& details) override;
+ // chrome::BrowserListObserver:
+ void OnBrowserClosing(Browser* browser) override;
+
Profile* profile_;
// True if we should save the pinned tabs when a browser window closes or the
@@ -38,6 +46,8 @@ class PinnedTabService : public content::NotificationObserver,
content::NotificationRegistrar registrar_;
+ ScopedObserver<BrowserList, BrowserListObserver> browser_list_observer_;
+
DISALLOW_COPY_AND_ASSIGN(PinnedTabService);
};
« no previous file with comments | « chrome/browser/ui/extensions/extension_installed_bubble.cc ('k') | chrome/browser/ui/tabs/pinned_tab_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698