Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / chrome / common / mac / app_shim_messages.h
blob95939296f7262c3214bde314fdec3e9620078c6c
1 // Copyright 2013 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.
5 // Multiply-included message file, hence no include guard.
7 #include <string>
8 #include <vector>
10 #include "base/files/file_path.h"
11 #include "chrome/common/mac/app_shim_launch.h"
12 #include "ipc/ipc_message_macros.h"
13 #include "ipc/ipc_message_utils.h"
14 #include "ipc/param_traits_macros.h"
16 #define IPC_MESSAGE_START AppShimMsgStart
18 IPC_ENUM_TRAITS_MAX_VALUE(apps::AppShimLaunchType,
19 apps::APP_SHIM_LAUNCH_NUM_TYPES - 1)
20 IPC_ENUM_TRAITS_MAX_VALUE(apps::AppShimLaunchResult,
21 apps::APP_SHIM_LAUNCH_NUM_RESULTS - 1)
22 IPC_ENUM_TRAITS_MAX_VALUE(apps::AppShimFocusType,
23 apps::APP_SHIM_FOCUS_NUM_TYPES - 1)
24 IPC_ENUM_TRAITS_MAX_VALUE(apps::AppShimAttentionType,
25 apps::APP_SHIM_ATTENTION_NUM_TYPES - 1)
27 // IMPORTANT: Since app shims could be running a newer framework version to the
28 // currently running Chrome, any changes to these IPCs must maintain the same
29 // order and format. I.e. Only add to the bottom, don't delete any.
31 // Signals that a previous LaunchApp message has been processed, and lets the
32 // app shim process know whether it was registered successfully.
33 IPC_MESSAGE_CONTROL1(AppShimMsg_LaunchApp_Done,
34 apps::AppShimLaunchResult /* launch result */)
36 // Instructs the shim to hide the app.
37 IPC_MESSAGE_CONTROL0(AppShimMsg_Hide)
39 // Deprecated. Do not delete.
40 IPC_MESSAGE_CONTROL0(AppShimMsg_RequestUserAttention)
42 // Signals to the main Chrome process that a shim has started. Indicates the
43 // profile and app_id that the shim should be associated with and whether to
44 // launch the app immediately.
45 IPC_MESSAGE_CONTROL4(AppShimHostMsg_LaunchApp,
46 base::FilePath /* profile dir */,
47 std::string /* app id */,
48 apps::AppShimLaunchType /* launch type */,
49 std::vector<base::FilePath> /* files */)
51 // Sent when the user has indicated a desire to focus the app, either by
52 // clicking on the app's icon in the dock or by selecting it with Cmd+Tab. In
53 // response, Chrome brings the app's windows to the foreground, or relaunches
54 // if the focus type indicates a reopen and there are no open windows.
55 IPC_MESSAGE_CONTROL2(AppShimHostMsg_FocusApp,
56 apps::AppShimFocusType /* focus type */,
57 std::vector<base::FilePath> /* files */)
59 // Sent when the app shim is hidden or unhidden.
60 IPC_MESSAGE_CONTROL1(AppShimHostMsg_SetAppHidden,
61 bool /* hidden */)
63 // Sent when the shim process receives a request to terminate. Once all of the
64 // app's windows have closed, and the extension is unloaded, the AppShimHost
65 // closes the channel. The shim process then completes the terminate request
66 // and exits.
67 IPC_MESSAGE_CONTROL0(AppShimHostMsg_QuitApp)
69 // Instructs the shim to request or cancel user attention.
70 IPC_MESSAGE_CONTROL1(AppShimMsg_SetUserAttention,
71 apps::AppShimAttentionType /* attention_type */)
73 // Instructs the shim to show the app.
74 IPC_MESSAGE_CONTROL0(AppShimMsg_UnhideWithoutActivation)