OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Multiply-included message file, hence no include guard. | 5 // Multiply-included message file, hence no include guard. |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "apps/app_shim/app_shim_launch.h" | 10 #include "apps/app_shim/app_shim_launch.h" |
11 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
12 #include "ipc/ipc_message_macros.h" | 12 #include "ipc/ipc_message_macros.h" |
13 #include "ipc/ipc_message_utils.h" | 13 #include "ipc/ipc_message_utils.h" |
14 #include "ipc/param_traits_macros.h" | 14 #include "ipc/param_traits_macros.h" |
15 | 15 |
16 #define IPC_MESSAGE_START AppShimMsgStart | 16 #define IPC_MESSAGE_START AppShimMsgStart |
17 | 17 |
18 IPC_ENUM_TRAITS_MAX_VALUE(apps::AppShimLaunchType, | 18 IPC_ENUM_TRAITS_MAX_VALUE(apps::AppShimLaunchType, |
19 apps::APP_SHIM_LAUNCH_NUM_TYPES - 1) | 19 apps::APP_SHIM_LAUNCH_NUM_TYPES - 1) |
20 IPC_ENUM_TRAITS_MAX_VALUE(apps::AppShimLaunchResult, | 20 IPC_ENUM_TRAITS_MAX_VALUE(apps::AppShimLaunchResult, |
21 apps::APP_SHIM_LAUNCH_NUM_RESULTS - 1) | 21 apps::APP_SHIM_LAUNCH_NUM_RESULTS - 1) |
22 IPC_ENUM_TRAITS_MAX_VALUE(apps::AppShimFocusType, | 22 IPC_ENUM_TRAITS_MAX_VALUE(apps::AppShimFocusType, |
23 apps::APP_SHIM_FOCUS_NUM_TYPES - 1) | 23 apps::APP_SHIM_FOCUS_NUM_TYPES - 1) |
24 IPC_ENUM_TRAITS_MAX_VALUE(apps::AppShimAttentionType, | |
25 apps::APP_SHIM_ATTENTION_NUM_TYPES - 1) | |
24 | 26 |
25 // Signals that a previous LaunchApp message has been processed, and lets the | 27 // Signals that a previous LaunchApp message has been processed, and lets the |
26 // app shim process know whether it was registered successfully. | 28 // app shim process know whether it was registered successfully. |
27 IPC_MESSAGE_CONTROL1(AppShimMsg_LaunchApp_Done, | 29 IPC_MESSAGE_CONTROL1(AppShimMsg_LaunchApp_Done, |
28 apps::AppShimLaunchResult /* launch result */) | 30 apps::AppShimLaunchResult /* launch result */) |
29 | 31 |
30 // Instructs the shim to hide the app. | 32 // Instructs the shim to hide the app. |
31 IPC_MESSAGE_CONTROL0(AppShimMsg_Hide) | 33 IPC_MESSAGE_CONTROL0(AppShimMsg_Hide) |
32 | 34 |
33 // Instructs the shim to request user attention. | 35 // Instructs the shim to request user attention. |
34 IPC_MESSAGE_CONTROL0(AppShimMsg_RequestUserAttention) | 36 IPC_MESSAGE_CONTROL1(AppShimMsg_RequestUserAttention, |
tapted
2014/08/13 03:37:08
So.. now that this is released, I'm not sure how s
jackhou1
2014/08/13 05:53:45
Argh.
Just adding a new IPC message instead.
As
| |
37 apps::AppShimAttentionType /* attention_type */) | |
35 | 38 |
36 // Signals to the main Chrome process that a shim has started indicating the | 39 // Signals to the main Chrome process that a shim has started indicating the |
37 // profile and app_id that the shim should be associated with and whether to | 40 // profile and app_id that the shim should be associated with and whether to |
38 // launch the app immediately. | 41 // launch the app immediately. |
39 IPC_MESSAGE_CONTROL4(AppShimHostMsg_LaunchApp, | 42 IPC_MESSAGE_CONTROL4(AppShimHostMsg_LaunchApp, |
40 base::FilePath /* profile dir */, | 43 base::FilePath /* profile dir */, |
41 std::string /* app id */, | 44 std::string /* app id */, |
42 apps::AppShimLaunchType /* launch type */, | 45 apps::AppShimLaunchType /* launch type */, |
43 std::vector<base::FilePath> /* files */) | 46 std::vector<base::FilePath> /* files */) |
44 | 47 |
45 // Sent when the user has indicated a desire to focus the app, either by | 48 // Sent when the user has indicated a desire to focus the app, either by |
46 // clicking on the app's icon in the dock or by selecting it with Cmd+Tab. In | 49 // clicking on the app's icon in the dock or by selecting it with Cmd+Tab. In |
47 // response, Chrome brings the app's windows to the foreground, or relaunches | 50 // response, Chrome brings the app's windows to the foreground, or relaunches |
48 // if the focus type indicates a reopen and there are no open windows. | 51 // if the focus type indicates a reopen and there are no open windows. |
49 IPC_MESSAGE_CONTROL2(AppShimHostMsg_FocusApp, | 52 IPC_MESSAGE_CONTROL2(AppShimHostMsg_FocusApp, |
50 apps::AppShimFocusType /* focus type */, | 53 apps::AppShimFocusType /* focus type */, |
51 std::vector<base::FilePath> /* files */) | 54 std::vector<base::FilePath> /* files */) |
52 | 55 |
53 // Sent when the app shim is hidden or unhidden. | 56 // Sent when the app shim is hidden or unhidden. |
54 IPC_MESSAGE_CONTROL1(AppShimHostMsg_SetAppHidden, | 57 IPC_MESSAGE_CONTROL1(AppShimHostMsg_SetAppHidden, |
55 bool /* hidden */) | 58 bool /* hidden */) |
56 | 59 |
57 // Sent when the shim process receives a request to terminate. Once all of the | 60 // Sent when the shim process receives a request to terminate. Once all of the |
58 // app's windows have closed, and the extension is unloaded, the AppShimHost | 61 // app's windows have closed, and the extension is unloaded, the AppShimHost |
59 // closes the channel. The shim process then completes the terminate request | 62 // closes the channel. The shim process then completes the terminate request |
60 // and exits. | 63 // and exits. |
61 IPC_MESSAGE_CONTROL0(AppShimHostMsg_QuitApp) | 64 IPC_MESSAGE_CONTROL0(AppShimHostMsg_QuitApp) |
OLD | NEW |