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..638247f32811a3875f64b2550a0a36dc1d10a898 |
--- /dev/null |
+++ b/extensions/browser/event_page_tracker.h |
@@ -0,0 +1,41 @@ |
+// 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 |
mark a. foltz
2015/04/24 22:54:48
Maybe:
Tracks an extension's event page suspend s
mark a. foltz
2015/04/24 22:54:48
Or just "Tracks an extension's..." as all classes
Kevin M
2015/04/27 19:45:38
Acknowledged.
Kevin M
2015/04/27 19:45:38
Done.
|
+// 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( |
mark a. foltz
2015/04/24 22:54:48
Why not have an IsSuspended(extension_id) that is
Kevin M
2015/04/27 19:45:37
Done. I originally created this class to simply ex
|
+ const std::string& extension_id) = 0; |
+ |
+ // Wakes an extension from a suspended state and calls |callback| after it is |
mark a. foltz
2015/04/24 22:54:48
As a nit, I would omit everything after |callback|
Kevin M
2015/04/27 19:45:37
How's this?
|
+ // reactivated. The callback is passed true if the extension was |
mark a. foltz
2015/04/24 22:54:48
s/The callback/|callback|/
mark a. foltz
2015/04/24 22:54:48
s/reactivated/awoken/
Kevin M
2015/04/27 19:45:37
Done.
|
+ // woken up successfully, or false if an error occurred. |
mark a. foltz
2015/04/24 22:54:48
If an error occurs, is the suspend/wake status of
|
+ // |
+ // Function returns true if a wake operation is scheduled, or false if the |
mark a. foltz
2015/04/24 22:54:48
s/Function//
Kevin M
2015/04/27 19:45:38
Done.
|
+ // extension is already active and does not require waking. |
mark a. foltz
2015/04/24 22:54:48
s/active/awake/ and omit the rest
Kevin M
2015/04/27 19:45:37
Done.
|
+ virtual bool WakeExtension(const std::string& extension_id, |
+ const base::Callback<void(bool)>& callback) = 0; |
+}; |
+ |
+} // namespace extensions |
+ |
+#endif // EXTENSIONS_BROWSER_EVENT_PAGE_TRACKER_H_ |