Extensions cleanup: Merge IsSyncableApp+Extension, ShouldSyncApp+Extension
[chromium-blink-merge.git] / chrome / browser / extensions / state_store_notification_observer.h
blob8b30127afa93b9da4d6cf302ea6315c5a2e265be
1 // Copyright 2014 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.
5 #ifndef CHROME_BROWSER_EXTENSIONS_STATE_STORE_NOTIFICATION_OBSERVER_H_
6 #define CHROME_BROWSER_EXTENSIONS_STATE_STORE_NOTIFICATION_OBSERVER_H_
8 #include "base/compiler_specific.h"
9 #include "base/macros.h"
10 #include "chrome/browser/sessions/session_restore.h"
12 namespace extensions {
13 class StateStore;
15 // Initializes the StateStore when session restore is complete, for example when
16 // page load notifications are not sent ("Continue where I left off").
17 // http://crbug.com/230481
18 class StateStoreNotificationObserver {
19 public:
20 explicit StateStoreNotificationObserver(StateStore* state_store);
21 ~StateStoreNotificationObserver();
23 private:
24 // Called when a session restore has finished.
25 void OnSessionRestoreDone(int num_tabs_restored);
27 StateStore* state_store_; // Not owned.
29 // Points to the on-session-restored callback that was registered with
30 // SessionRestore's callback list. When objects of this class are destroyed,
31 // the subscription object's destructor will automatically unregister the
32 // callback in SessionRestore, so that the callback list does not contain any
33 // obsolete callbacks.
34 SessionRestore::CallbackSubscription
35 on_session_restored_callback_subscription_;
37 DISALLOW_COPY_AND_ASSIGN(StateStoreNotificationObserver);
40 } // namespace extensions
42 #endif // CHROME_BROWSER_EXTENSIONS_STATE_STORE_NOTIFICATION_OBSERVER_H_