• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
3// found in the LICENSE file.
4
5#include "chrome/common/mac/app_mode_common.h"
6
7#include "base/files/file_util.h"
8
9namespace app_mode {
10
11const char kAppShimSocketShortName[] = "Socket";
12const char kAppShimSocketSymlinkName[] = "App Shim Socket";
13
14const char kRunningChromeVersionSymlinkName[] = "RunningChromeVersion";
15
16const char kAppListModeId[] = "app_list";
17
18const char kLaunchedByChromeProcessId[] = "launched-by-chrome-process-id";
19const char kLaunchedForTest[] = "launched-for-test";
20const char kLaunchedAfterRebuild[] = "launched-after-rebuild";
21
22const char kAppShimError[] = "app-shim-error";
23
24NSString* const kCFBundleDocumentTypesKey = @"CFBundleDocumentTypes";
25NSString* const kCFBundleTypeExtensionsKey = @"CFBundleTypeExtensions";
26NSString* const kCFBundleTypeIconFileKey = @"CFBundleTypeIconFile";
27NSString* const kCFBundleTypeNameKey = @"CFBundleTypeName";
28NSString* const kCFBundleTypeMIMETypesKey = @"CFBundleTypeMIMETypes";
29NSString* const kCFBundleTypeRoleKey = @"CFBundleTypeRole";
30NSString* const kBundleTypeRoleViewer = @"Viewer";
31
32NSString* const kCFBundleDisplayNameKey = @"CFBundleDisplayName";
33NSString* const kCFBundleShortVersionStringKey = @"CFBundleShortVersionString";
34NSString* const kLSHasLocalizedDisplayNameKey = @"LSHasLocalizedDisplayName";
35NSString* const kBrowserBundleIDKey = @"CrBundleIdentifier";
36NSString* const kCrAppModeShortcutIDKey = @"CrAppModeShortcutID";
37NSString* const kCrAppModeShortcutNameKey = @"CrAppModeShortcutName";
38NSString* const kCrAppModeShortcutURLKey = @"CrAppModeShortcutURL";
39NSString* const kCrAppModeUserDataDirKey = @"CrAppModeUserDataDir";
40NSString* const kCrAppModeProfileDirKey = @"CrAppModeProfileDir";
41NSString* const kCrAppModeProfileNameKey = @"CrAppModeProfileName";
42
43NSString* const kLastRunAppBundlePathPrefsKey = @"LastRunAppBundlePath";
44
45NSString* const kShortcutIdPlaceholder = @"APP_MODE_SHORTCUT_ID";
46NSString* const kShortcutNamePlaceholder = @"APP_MODE_SHORTCUT_NAME";
47NSString* const kShortcutURLPlaceholder = @"APP_MODE_SHORTCUT_URL";
48NSString* const kShortcutBrowserBundleIDPlaceholder =
49                    @"APP_MODE_BROWSER_BUNDLE_ID";
50
51ChromeAppModeInfo::ChromeAppModeInfo()
52    : major_version(0),
53      minor_version(0),
54      argc(0),
55      argv(0) {
56}
57
58ChromeAppModeInfo::~ChromeAppModeInfo() {
59}
60
61void VerifySocketPermissions(const base::FilePath& socket_path) {
62  CHECK(base::PathIsWritable(socket_path));
63  base::FilePath socket_dir = socket_path.DirName();
64  int socket_dir_mode = 0;
65  CHECK(base::GetPosixFilePermissions(socket_dir, &socket_dir_mode));
66  CHECK_EQ(0700, socket_dir_mode);
67}
68
69}  // namespace app_mode
70