MacViews: Get c/b/ui/views/tabs to build on Mac
[chromium-blink-merge.git] / chrome / browser / extensions / state_store_notification_observer.cc
blob0e5084ca6b537ba20d5670891fa4ba679e7d168a
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 registrar_.Add(this,
18 chrome::NOTIFICATION_SESSION_RESTORE_DONE,
19 content::NotificationService::AllBrowserContextsAndSources());
22 StateStoreNotificationObserver::~StateStoreNotificationObserver() {
25 void StateStoreNotificationObserver::Observe(
26 int type,
27 const content::NotificationSource& source,
28 const content::NotificationDetails& details) {
29 DCHECK_EQ(type, chrome::NOTIFICATION_SESSION_RESTORE_DONE);
30 registrar_.RemoveAll();
31 state_store_->RequestInitAfterDelay();
34 } // namespace extensions