OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef CHROME_COMMON_MAC_APP_MODE_COMMON_H_ | 5 #ifndef CHROME_COMMON_MAC_APP_MODE_COMMON_H_ |
6 #define CHROME_COMMON_MAC_APP_MODE_COMMON_H_ | 6 #define CHROME_COMMON_MAC_APP_MODE_COMMON_H_ |
7 | 7 |
8 #import <Foundation/Foundation.h> | 8 #import <Foundation/Foundation.h> |
9 | 9 |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
11 #include "base/strings/string16.h" | 11 #include "base/strings/string16.h" |
12 | 12 |
13 // This file contains constants, interfaces, etc. which are common to the | 13 // This file contains constants, interfaces, etc. which are common to the |
14 // browser application and the app mode loader (a.k.a. shim). | 14 // browser application and the app mode loader (a.k.a. shim). |
15 | 15 |
16 namespace app_mode { | 16 namespace app_mode { |
17 | 17 |
18 // These are keys for an Apple Event ping that the app shim process sends to | 18 // These are keys for an Apple Event ping that the app shim process sends to |
19 // Chrome to get confirmation that Chrome is alive. The main Chrome process | 19 // Chrome to get confirmation that Chrome is alive. The main Chrome process |
20 // doesn't need to register any handlers for them -- the event is just sent for | 20 // doesn't need to register any handlers for them -- the event is just sent for |
21 // the empty reply that's automatically returned by the system. | 21 // the empty reply that's automatically returned by the system. |
22 const AEEventClass kAEChromeAppClass = 'cApp'; | 22 const AEEventClass kAEChromeAppClass = 'cApp'; |
23 const AEEventID kAEChromeAppPing = 'ping'; | 23 const AEEventID kAEChromeAppPing = 'ping'; |
24 | 24 |
25 // The IPC socket used to communicate between app shims and Chrome will be | 25 // The IPC socket used to communicate between app shims and Chrome will be |
26 // created under the user data directory with this name. | 26 // created under a temporary directory with this name. |
27 extern const char kAppShimSocketName[]; | 27 extern const char kAppShimSocketShortName[]; |
| 28 // A symlink to allow the app shim to find the socket will be created under the |
| 29 // user data dir with this name. |
| 30 extern const char kAppShimSocketSymlinkName[]; |
28 | 31 |
29 // Special app mode id used for the App Launcher. | 32 // Special app mode id used for the App Launcher. |
30 extern const char kAppListModeId[]; | 33 extern const char kAppListModeId[]; |
31 | 34 |
32 // The process ID of the Chrome process that launched the app shim. | 35 // The process ID of the Chrome process that launched the app shim. |
33 // The presence of this switch instructs the app shim to send LaunchApp with | 36 // The presence of this switch instructs the app shim to send LaunchApp with |
34 // launch_now = false. This associates the shim without launching the app. | 37 // launch_now = false. This associates the shim without launching the app. |
35 extern const char kLaunchedByChromeProcessId[]; | 38 extern const char kLaunchedByChromeProcessId[]; |
36 | 39 |
37 // The display name of the bundle as shown in Finder and the Dock. For localized | 40 // The display name of the bundle as shown in Finder and the Dock. For localized |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 // URL for the shortcut. Must be a valid URL. | 123 // URL for the shortcut. Must be a valid URL. |
121 std::string app_mode_url; // Required: v1.0 | 124 std::string app_mode_url; // Required: v1.0 |
122 | 125 |
123 // Path to the app's user data directory. | 126 // Path to the app's user data directory. |
124 base::FilePath user_data_dir; | 127 base::FilePath user_data_dir; |
125 | 128 |
126 // Directory of the profile associated with the app. | 129 // Directory of the profile associated with the app. |
127 base::FilePath profile_dir; | 130 base::FilePath profile_dir; |
128 }; | 131 }; |
129 | 132 |
| 133 // Check that the socket and its parent directory have the correct permissions |
| 134 // and are owned by the user. |
| 135 void VerifySocketPermissions(const base::FilePath& socket_path); |
| 136 |
130 } // namespace app_mode | 137 } // namespace app_mode |
131 | 138 |
132 #endif // CHROME_COMMON_MAC_APP_MODE_COMMON_H_ | 139 #endif // CHROME_COMMON_MAC_APP_MODE_COMMON_H_ |
OLD | NEW |