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); |
}; |