Chromium Code Reviews| Index: extensions/browser/event_page_tracker.h |
| diff --git a/extensions/browser/event_page_tracker.h b/extensions/browser/event_page_tracker.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..4934bdc3f2f84e6a9607daa2d230972156ec8794 |
| --- /dev/null |
| +++ b/extensions/browser/event_page_tracker.h |
| @@ -0,0 +1,39 @@ |
| +// Copyright 2015 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef EXTENSIONS_BROWSER_EVENT_PAGE_TRACKER_H_ |
| +#define EXTENSIONS_BROWSER_EVENT_PAGE_TRACKER_H_ |
| + |
| +#include <string> |
| + |
| +#include "base/callback.h" |
| + |
| +namespace extensions { |
| + |
| +class Extension; |
| +class ExtensionHost; |
| + |
| +// Defines a set of methods that can be used to track an extension's event page |
| +// suspend state. |
| +class EventPageTracker { |
| + public: |
| + // Gets the ExtensionHost for the background page for an extension, or null if |
| + // the extension isn't running or doesn't have a background page. |
| + // |
| + // A non-null return value indicates that an extension's event page is active; |
| + // null indicates that it is suspended. |
| + virtual ExtensionHost* GetBackgroundHostForExtension( |
| + const std::string& extension_id) = 0; |
|
not at google - send to devlin
2015/04/24 20:05:08
GetEventPageForExtension? Just "background host" i
Kevin Marshall
2015/04/24 21:04:53
This function is a pre-existing method in ProcessM
not at google - send to devlin
2015/04/24 21:20:43
Sure, if you prefer a bool then makes sense to cre
|
| + |
| + // Wakes an extension from a suspended state. |
| + // |callback| is called with true if the extension was successfully loaded |
| + // or if it was already active; false if the extension failed |
| + // to load. |
| + virtual void WakeExtension(const std::string& extension_id, |
| + const base::Callback<void(bool)>& callback) = 0; |
| +}; |
| + |
| +} // namespace extensions |
| + |
| +#endif // EXTENSIONS_BROWSER_EVENT_PAGE_TRACKER_H_ |