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. 4 5#ifndef CHROME_BROWSER_EXTENSIONS_STATE_STORE_NOTIFICATION_OBSERVER_H_ 6#define CHROME_BROWSER_EXTENSIONS_STATE_STORE_NOTIFICATION_OBSERVER_H_ 7 8#include "base/compiler_specific.h" 9#include "base/macros.h" 10#include "content/public/browser/notification_observer.h" 11#include "content/public/browser/notification_registrar.h" 12 13namespace extensions { 14class StateStore; 15 16// Initializes the StateStore when session restore is complete, for example when 17// page load notifications are not sent ("Continue where I left off"). 18// http://crbug.com/230481 19class StateStoreNotificationObserver : public content::NotificationObserver { 20 public: 21 explicit StateStoreNotificationObserver(StateStore* state_store); 22 virtual ~StateStoreNotificationObserver(); 23 24 // content::NotificationObserver overrides: 25 virtual void Observe(int type, 26 const content::NotificationSource& source, 27 const content::NotificationDetails& details) OVERRIDE; 28 29 private: 30 StateStore* state_store_; // Not owned. 31 content::NotificationRegistrar registrar_; 32 33 DISALLOW_COPY_AND_ASSIGN(StateStoreNotificationObserver); 34}; 35 36} // namespace extensions 37 38#endif // CHROME_BROWSER_EXTENSIONS_STATE_STORE_NOTIFICATION_OBSERVER_H_ 39