Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(69)

Unified Diff: extensions/browser/event_page_tracker.h

Issue 1096313003: Create interface "EventPageTracker" for checking an extension's (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Code review feedback. Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | extensions/browser/process_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..c7750fe74cd77c3de88d2d3d053b02f95beaf88f
--- /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:
+ // Returns true if an extension's event page is active,
+ // or false if it is suspended.
+ virtual bool IsEventPageActive(const std::string& extension_id) = 0;
+
+ // Wakes an extension's event page from a suspended state and calls
+ // |callback| after it is reactivated.
+ //
+ // The callback will be passed true if the extension was
mark a. foltz 2015/04/27 23:26:40 Rewrap this to 80 cols.
Kevin M 2015/04/28 21:12:14 Done.
+ // woken up successfully, or false if an error occurred.
+ //
+ // Function will return true if a wake operation was scheduled successfully,
+ // or false if the event page was already active and did not require waking.
+ virtual bool WakeEventPage(const std::string& extension_id,
+ const base::Callback<void(bool)>& callback) = 0;
+};
+
+} // namespace extensions
+
+#endif // EXTENSIONS_BROWSER_EVENT_PAGE_TRACKER_H_
« no previous file with comments | « no previous file | extensions/browser/process_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698