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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | extensions/browser/process_manager.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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 // 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.
18 // suspend state.
19 class EventPageTracker {
20 public:
21 // Gets the ExtensionHost for the background page for an extension, or null if
22 // the extension isn't running or doesn't have a background page.
23 //
24 // A non-null return value indicates that an extension's event page is active;
25 // null indicates that it is suspended.
26 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
27 const std::string& extension_id) = 0;
28
29 // 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?
30 // 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.
31 // 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
32 //
33 // 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.
34 // 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.
35 virtual bool WakeExtension(const std::string& extension_id,
36 const base::Callback<void(bool)>& callback) = 0;
37 };
38
39 } // namespace extensions
40
41 #endif // EXTENSIONS_BROWSER_EVENT_PAGE_TRACKER_H_
OLDNEW
« 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