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

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: More documentation. 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') | extensions/browser/process_manager.cc » ('J')
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..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_
« no previous file with comments | « no previous file | extensions/browser/process_manager.h » ('j') | extensions/browser/process_manager.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698