OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 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 EXTENSIONS_BROWSER_EVENT_PAGE_TRACKER_H_ |
| 6 #define EXTENSIONS_BROWSER_EVENT_PAGE_TRACKER_H_ |
| 7 |
| 8 #include <string> |
| 9 |
| 10 #include "base/callback.h" |
| 11 |
| 12 namespace extensions { |
| 13 |
| 14 class Extension; |
| 15 class ExtensionHost; |
| 16 |
| 17 // Tracks an extension's event page suspend state. |
| 18 class EventPageTracker { |
| 19 public: |
| 20 // Returns true if an extension's event page is active, |
| 21 // or false if it is suspended. |
| 22 virtual bool IsEventPageSuspended(const std::string& extension_id) = 0; |
| 23 |
| 24 // Wakes an extension's event page from a suspended state and calls |
| 25 // |callback| after it is reactivated. |
| 26 // |
| 27 // |callback| will be passed true if the extension was reactivated |
| 28 // successfully, or false if an error occurred. |
| 29 // |
| 30 // Returns true if a wake operation was scheduled successfully, |
| 31 // or false if the event page was already awake. |
| 32 // Callback will be run asynchronously if true, and never run if false. |
| 33 virtual bool WakeEventPage(const std::string& extension_id, |
| 34 const base::Callback<void(bool)>& callback) = 0; |
| 35 }; |
| 36 |
| 37 } // namespace extensions |
| 38 |
| 39 #endif // EXTENSIONS_BROWSER_EVENT_PAGE_TRACKER_H_ |
OLD | NEW |