Adding instrumentation to locate the source of jankiness
[chromium-blink-merge.git] / chrome / browser / extensions / state_store_notification_observer.h
blob0266e592c0535636343399fb6b205449d2613587
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 "content/public/browser/notification_observer.h"
11 #include "content/public/browser/notification_registrar.h"
13 namespace extensions {
14 class StateStore;
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
19 class StateStoreNotificationObserver : public content::NotificationObserver {
20 public:
21 explicit StateStoreNotificationObserver(StateStore* state_store);
22 virtual ~StateStoreNotificationObserver();
24 // content::NotificationObserver overrides:
25 virtual void Observe(int type,
26 const content::NotificationSource& source,
27 const content::NotificationDetails& details) override;
29 private:
30 StateStore* state_store_; // Not owned.
31 content::NotificationRegistrar registrar_;
33 DISALLOW_COPY_AND_ASSIGN(StateStoreNotificationObserver);
36 } // namespace extensions
38 #endif // CHROME_BROWSER_EXTENSIONS_STATE_STORE_NOTIFICATION_OBSERVER_H_