OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_TABS_PINNED_TAB_SERVICE_H_ |
| 6 #define CHROME_BROWSER_TABS_PINNED_TAB_SERVICE_H_ |
| 7 |
| 8 #include "chrome/common/notification_observer.h" |
| 9 #include "chrome/common/notification_registrar.h" |
| 10 |
| 11 class Browser; |
| 12 class Profile; |
| 13 |
| 14 // PinnedTabService is responsible for updating preferences with the set of |
| 15 // pinned tabs to restore at startup. PinnedTabService listens for the |
| 16 // appropriate set of notifications to know it should update preferences. |
| 17 class PinnedTabService : public NotificationObserver { |
| 18 public: |
| 19 explicit PinnedTabService(Profile* profile); |
| 20 |
| 21 private: |
| 22 // Invoked when we're about to exit. |
| 23 void GotExit(); |
| 24 |
| 25 // NotificationObserver. |
| 26 virtual void Observe(NotificationType type, |
| 27 const NotificationSource& source, |
| 28 const NotificationDetails& details); |
| 29 |
| 30 Profile* profile_; |
| 31 |
| 32 // If true we've seen an exit event (or the last browser is closing which |
| 33 // triggers an exit) and can ignore all other events. |
| 34 bool got_exiting_; |
| 35 |
| 36 NotificationRegistrar registrar_; |
| 37 |
| 38 DISALLOW_COPY_AND_ASSIGN(PinnedTabService); |
| 39 }; |
| 40 |
| 41 #endif // CHROME_BROWSER_TABS_PINNED_TAB_SERVICE_H_ |
OLD | NEW |