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 #include "chrome/browser/extensions/state_store_notification_observer.h"
7 #include "base/logging.h"
8 #include "chrome/browser/chrome_notification_types.h"
9 #include "content/public/browser/notification_service.h"
10 #include "extensions/browser/state_store.h"
12 namespace extensions
{
14 StateStoreNotificationObserver::StateStoreNotificationObserver(
15 StateStore
* state_store
)
16 : state_store_(state_store
) {
17 on_session_restored_callback_subscription_
=
18 SessionRestore::RegisterOnSessionRestoredCallback(
19 base::Bind(&StateStoreNotificationObserver::OnSessionRestoreDone
,
20 base::Unretained(this)));
23 StateStoreNotificationObserver::~StateStoreNotificationObserver() {
26 void StateStoreNotificationObserver::OnSessionRestoreDone(
27 int /* num_tabs_restored */) {
28 on_session_restored_callback_subscription_
.reset();
29 state_store_
->RequestInitAfterDelay();
32 } // namespace extensions