blob: a484e09fc7f9750ab86f1dc89ae034d083d81ca6 [file] [log] [blame]
David Bertoni3e1e9fa2018-08-29 20:39:301// Copyright 2018 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_ACTIVITY_H_
6#define EXTENSIONS_BROWSER_ACTIVITY_H_
7
8namespace extensions {
9
10struct Activity {
11 enum Type {
12 // The activity is an Extensions API function call. The extra data is the
13 // function name.
14 API_FUNCTION,
15
16 // The activity is for the Developer Tools client. The extra data is an
17 // empty string.
18 DEV_TOOLS,
19
20 // The activity is an event. The extra data is the event name.
21 EVENT,
22
23 // The activity is meant to keep the background page alive during an
24 // IPC call or during page creation. Use the constants kIPC or
25 // kCreatePage.
26 LIFECYCLE_MANAGEMENT,
27
28 // The activity is related to the media manager. Use the constant
29 // kPictureInPicture.
30 MEDIA,
31
32 // The activity is a message. The extra data is the port ID.
33 MESSAGE_PORT,
34
35 // The activity is meant to keep the background page alive while
36 // a modal dialog box is visible. The extra data is the URL of the
37 // calling page.
38 MODAL_DIALOG,
39
40 // The activity is a Mojo API function call. The extra data is an empty
41 // string.
42 MOJO,
43
44 // The activity is a network request. The extra data is the request ID.
45 NETWORK,
46
47 // The activity is a Pepper API function call. The extra data is an empty
48 // string.
49 PEPPER_API,
50
51 // The activity is internal ProcessManager bookkeeping. The extra data
52 // is one of kCancelSuspend or kRenderFrame.
53 PROCESS_MANAGER,
54 };
55
David Bertoni2cb53ba2018-08-30 21:08:3356 static const char* ToString(Type type);
57
David Bertoni3e1e9fa2018-08-29 20:39:3058 static const char kCancelSuspend[];
59 static const char kCreatePage[];
60 static const char kIPC[];
61 static const char kPictureInPicture[];
62 static const char kRenderFrame[];
63};
64
65} // namespace extensions
66
67#endif // EXTENSIONS_BROWSER_ACTIVITY_H_