| 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #import <Foundation/Foundation.h> | 9 #import <Foundation/Foundation.h> |
| 10 | 10 |
| 11 #include "base/file_path.h" | 11 #include "base/file_path.h" |
| 12 #include "base/string16.h" | 12 #include "base/string16.h" |
| 13 | 13 |
| 14 // This file contains constants, interfaces, etc. which are common to the | 14 // This file contains constants, interfaces, etc. which are common to the |
| 15 // browser application and the app mode loader (a.k.a. shim). | 15 // browser application and the app mode loader (a.k.a. shim). |
| 16 | 16 |
| 17 namespace app_mode { | 17 namespace app_mode { |
| 18 | 18 |
| 19 // The key under which the browser's bundle ID will be stored in the | 19 // The key under which the browser's bundle ID will be stored in the |
| 20 // app mode launcher bundle's Info.plist. | 20 // app mode launcher bundle's Info.plist. |
| 21 extern NSString* const kBrowserBundleIDKey; | 21 extern NSString* const kBrowserBundleIDKey; |
| 22 | 22 |
| 23 // The key under which to record the path to the (user-visible) application | |
| 24 // bundle; this key is recorded under the ID given by |kAppPrefsID|. | |
| 25 extern NSString* const kLastRunAppBundlePathPrefsKey; | |
| 26 | |
| 27 // Key for the shortcut ID. | 23 // Key for the shortcut ID. |
| 28 extern NSString* const kCrAppModeShortcutIDKey; | 24 extern NSString* const kCrAppModeShortcutIDKey; |
| 29 | 25 |
| 30 // Key for the app's shortcut name. | 26 // Key for the app's shortcut name. |
| 31 extern NSString* const kCrAppModeShortcutShortNameKey; | 27 extern NSString* const kCrAppModeShortcutShortNameKey; |
| 32 | 28 |
| 33 // Key for the app's unrestricted name. | 29 // Key for the app's unrestricted name. |
| 34 extern NSString* const kCrAppModeShortcutNameKey; | 30 extern NSString* const kCrAppModeShortcutNameKey; |
| 35 | 31 |
| 36 // Key for the app's URL. | 32 // Key for the app's URL. |
| 37 extern NSString* const kCrAppModeShortcutURLKey; | 33 extern NSString* const kCrAppModeShortcutURLKey; |
| 38 | 34 |
| 39 // Key for the app user data directory. | 35 // Key for the app user data directory. |
| 40 extern NSString* const kCrAppModeUserDataDirKey; | 36 extern NSString* const kCrAppModeUserDataDirKey; |
| 41 | 37 |
| 42 // Key for the app's extension path. | 38 // Key for the app's extension path. |
| 43 extern NSString* const kCrAppModeExtensionPathKey; | 39 extern NSString* const kCrAppModeExtensionPathKey; |
| 44 | 40 |
| 41 // When the Chrome browser is run, it stores it's location in the defaults |
| 42 // system using this key. |
| 43 extern NSString* const kLastRunAppBundlePathPrefsKey; |
| 44 |
| 45 // Placeholder used in the Info.plist, meant to be replaced by the extension |
| 46 // shortcut ID. |
| 47 extern NSString* const kShortcutIdPlaceholder; |
| 48 |
| 45 // Current major/minor version numbers of |ChromeAppModeInfo| (defined below). | 49 // Current major/minor version numbers of |ChromeAppModeInfo| (defined below). |
| 46 const unsigned kCurrentChromeAppModeInfoMajorVersion = 1; | 50 const unsigned kCurrentChromeAppModeInfoMajorVersion = 1; |
| 47 const unsigned kCurrentChromeAppModeInfoMinorVersion = 0; | 51 const unsigned kCurrentChromeAppModeInfoMinorVersion = 0; |
| 48 | 52 |
| 49 // The structure used to pass information from the app mode loader to the | 53 // The structure used to pass information from the app mode loader to the |
| 50 // (browser) framework. This is versioned using major and minor version numbers, | 54 // (browser) framework. This is versioned using major and minor version numbers, |
| 51 // written below as v<major>.<minor>. Version-number checking is done by the | 55 // written below as v<major>.<minor>. Version-number checking is done by the |
| 52 // framework, and the framework must accept all structures with the same major | 56 // framework, and the framework must accept all structures with the same major |
| 53 // version number. It may refuse to load if the major version of the structure | 57 // version number. It may refuse to load if the major version of the structure |
| 54 // is different from the one it accepts. | 58 // is different from the one it accepts. |
| 55 struct ChromeAppModeInfo { | 59 struct ChromeAppModeInfo { |
| 56 public: | 60 public: |
| 57 ChromeAppModeInfo(); | 61 ChromeAppModeInfo(); |
| 58 ~ChromeAppModeInfo(); | 62 ~ChromeAppModeInfo(); |
| 59 | 63 |
| 60 // Major and minor version number of this structure. | 64 // Major and minor version number of this structure. |
| 61 unsigned major_version; // Required: all versions | 65 unsigned major_version; // Required: all versions |
| 62 unsigned minor_version; // Required: all versions | 66 unsigned minor_version; // Required: all versions |
| 63 | 67 |
| 64 // Original |argc| and |argv|. | 68 // Original |argc| and |argv|. |
| 65 int argc; // Required: v1.0 | 69 int argc; // Required: v1.0 |
| 66 char** argv; // Required: v1.0 | 70 char** argv; // Required: v1.0 |
| 67 | 71 |
| 68 // Versioned path to the browser which is being loaded. | 72 // Versioned path to the browser which is being loaded. |
| 69 FilePath chrome_versioned_path; // Required: v1.0 | 73 FilePath chrome_versioned_path; // Required: v1.0 |
| 70 | 74 |
| 75 // Path to Chrome app bundle. |
| 76 FilePath chrome_outer_bundle_path; // Required: v1.0 |
| 77 |
| 71 // Information about the App Mode shortcut: | 78 // Information about the App Mode shortcut: |
| 72 | 79 |
| 73 // Path to the App Mode Loader application bundle originally run. | 80 // Path to the App Mode Loader application bundle that launched the process. |
| 74 FilePath app_mode_bundle_path; // Optional: v1.0 | 81 FilePath app_mode_bundle_path; // Optional: v1.0 |
| 75 | 82 |
| 76 // Short ID string, preferably derived from |app_mode_short_name|. Should be | 83 // Short ID string, preferably derived from |app_mode_short_name|. Should be |
| 77 // safe for the file system. | 84 // safe for the file system. |
| 78 std::string app_mode_id; // Required: v1.0 | 85 std::string app_mode_id; // Required: v1.0 |
| 79 | 86 |
| 80 // Short (e.g., one-word) UTF8-encoded name for the shortcut. | 87 // Short (e.g., one-word) UTF8-encoded name for the shortcut. |
| 81 string16 app_mode_short_name; // Optional: v1.0 | 88 string16 app_mode_short_name; // Optional: v1.0 |
| 82 | 89 |
| 83 // Unrestricted (e.g., several-word) UTF8-encoded name for the shortcut. | 90 // Unrestricted (e.g., several-word) UTF8-encoded name for the shortcut. |
| 84 string16 app_mode_name; // Optional: v1.0 | 91 string16 app_mode_name; // Optional: v1.0 |
| 85 | 92 |
| 86 // URL for the shortcut. Must be a valid URL. | 93 // URL for the shortcut. Must be a valid URL. |
| 87 std::string app_mode_url; // Required: v1.0 | 94 std::string app_mode_url; // Required: v1.0 |
| 88 | 95 |
| 89 // Path to the app's user data directory. | 96 // Path to the app's user data directory. |
| 90 FilePath user_data_dir; | 97 FilePath user_data_dir; |
| 91 | 98 |
| 92 // Path to the app's extension. | 99 // Path to the app's extension. |
| 93 FilePath extension_path; | 100 FilePath extension_path; |
| 94 }; | 101 }; |
| 95 | 102 |
| 96 } // namespace app_mode | 103 } // namespace app_mode |
| 97 | 104 |
| 98 #endif // CHROME_COMMON_MAC_APP_MODE_COMMON_H_ | 105 #endif // CHROME_COMMON_MAC_APP_MODE_COMMON_H_ |
| OLD | NEW |