Adding instrumentation to locate the source of jankiness
[chromium-blink-merge.git] / chrome / common / mac / app_mode_common.mm
blob171c77f104e668d2fc441c9ed7be516ca56a1803
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.
5 #include "chrome/common/mac/app_mode_common.h"
7 #include "base/files/file_util.h"
9 namespace app_mode {
11 const char kAppShimSocketShortName[] = "Socket";
12 const char kAppShimSocketSymlinkName[] = "App Shim Socket";
14 const char kRunningChromeVersionSymlinkName[] = "RunningChromeVersion";
16 const char kAppListModeId[] = "app_list";
18 const char kLaunchedByChromeProcessId[] = "launched-by-chrome-process-id";
19 const char kLaunchedForTest[] = "launched-for-test";
20 const char kLaunchedAfterRebuild[] = "launched-after-rebuild";
22 const char kAppShimError[] = "app-shim-error";
24 NSString* const kCFBundleDocumentTypesKey = @"CFBundleDocumentTypes";
25 NSString* const kCFBundleTypeExtensionsKey = @"CFBundleTypeExtensions";
26 NSString* const kCFBundleTypeIconFileKey = @"CFBundleTypeIconFile";
27 NSString* const kCFBundleTypeNameKey = @"CFBundleTypeName";
28 NSString* const kCFBundleTypeMIMETypesKey = @"CFBundleTypeMIMETypes";
29 NSString* const kCFBundleTypeRoleKey = @"CFBundleTypeRole";
30 NSString* const kBundleTypeRoleViewer = @"Viewer";
32 NSString* const kCFBundleDisplayNameKey = @"CFBundleDisplayName";
33 NSString* const kCFBundleShortVersionStringKey = @"CFBundleShortVersionString";
34 NSString* const kLSHasLocalizedDisplayNameKey = @"LSHasLocalizedDisplayName";
35 NSString* const kBrowserBundleIDKey = @"CrBundleIdentifier";
36 NSString* const kCrAppModeShortcutIDKey = @"CrAppModeShortcutID";
37 NSString* const kCrAppModeShortcutNameKey = @"CrAppModeShortcutName";
38 NSString* const kCrAppModeShortcutURLKey = @"CrAppModeShortcutURL";
39 NSString* const kCrAppModeUserDataDirKey = @"CrAppModeUserDataDir";
40 NSString* const kCrAppModeProfileDirKey = @"CrAppModeProfileDir";
41 NSString* const kCrAppModeProfileNameKey = @"CrAppModeProfileName";
43 NSString* const kLastRunAppBundlePathPrefsKey = @"LastRunAppBundlePath";
45 NSString* const kShortcutIdPlaceholder = @"APP_MODE_SHORTCUT_ID";
46 NSString* const kShortcutNamePlaceholder = @"APP_MODE_SHORTCUT_NAME";
47 NSString* const kShortcutURLPlaceholder = @"APP_MODE_SHORTCUT_URL";
48 NSString* const kShortcutBrowserBundleIDPlaceholder =
49                     @"APP_MODE_BROWSER_BUNDLE_ID";
51 ChromeAppModeInfo::ChromeAppModeInfo()
52     : major_version(0),
53       minor_version(0),
54       argc(0),
55       argv(0) {
58 ChromeAppModeInfo::~ChromeAppModeInfo() {
61 void 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);
69 }  // namespace app_mode