| 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 // Key for the shortcut ID. | 23 // Key for the shortcut ID. |
| 24 extern NSString* const kCrAppModeShortcutIDKey; | 24 extern NSString* const kCrAppModeShortcutIDKey; |
| 25 | 25 |
| 26 // Key for the app's shortcut name. | 26 // Key for the app's name. |
| 27 extern NSString* const kCrAppModeShortcutShortNameKey; | |
| 28 | |
| 29 // Key for the app's unrestricted name. | |
| 30 extern NSString* const kCrAppModeShortcutNameKey; | 27 extern NSString* const kCrAppModeShortcutNameKey; |
| 31 | 28 |
| 32 // Key for the app's URL. | 29 // Key for the app's URL. |
| 33 extern NSString* const kCrAppModeShortcutURLKey; | 30 extern NSString* const kCrAppModeShortcutURLKey; |
| 34 | 31 |
| 35 // Key for the app user data directory. | 32 // Key for the app user data directory. |
| 36 extern NSString* const kCrAppModeUserDataDirKey; | 33 extern NSString* const kCrAppModeUserDataDirKey; |
| 37 | 34 |
| 38 // Key for the app's extension path. | 35 // Key for the app's extension path. |
| 39 extern NSString* const kCrAppModeExtensionPathKey; | 36 extern NSString* const kCrAppModeExtensionPathKey; |
| 40 | 37 |
| 41 // When the Chrome browser is run, it stores it's location in the defaults | 38 // When the Chrome browser is run, it stores it's location in the defaults |
| 42 // system using this key. | 39 // system using this key. |
| 43 extern NSString* const kLastRunAppBundlePathPrefsKey; | 40 extern NSString* const kLastRunAppBundlePathPrefsKey; |
| 44 | 41 |
| 45 // Placeholder used in the Info.plist, meant to be replaced by the extension | 42 // Placeholders used in the app mode loader bundle' Info.plist: |
| 46 // shortcut ID. | 43 extern NSString* const kShortcutIdPlaceholder; // Extension shortcut ID. |
| 47 extern NSString* const kShortcutIdPlaceholder; | 44 extern NSString* const kShortcutNamePlaceholder; // Extension name. |
| 45 extern NSString* const kShortcutURLPlaceholder; |
| 46 // Bundle ID of the Chrome browser bundle. |
| 47 extern NSString* const kShortcutBrowserBundleIDPlaceholder; |
| 48 | 48 |
| 49 // Current major/minor version numbers of |ChromeAppModeInfo| (defined below). | 49 // Current major/minor version numbers of |ChromeAppModeInfo| (defined below). |
| 50 const unsigned kCurrentChromeAppModeInfoMajorVersion = 1; | 50 const unsigned kCurrentChromeAppModeInfoMajorVersion = 1; |
| 51 const unsigned kCurrentChromeAppModeInfoMinorVersion = 0; | 51 const unsigned kCurrentChromeAppModeInfoMinorVersion = 0; |
| 52 | 52 |
| 53 // 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 |
| 54 // (browser) framework. This is versioned using major and minor version numbers, | 54 // (browser) framework. This is versioned using major and minor version numbers, |
| 55 // 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 |
| 56 // 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 |
| 57 // 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 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 77 | 77 |
| 78 // Information about the App Mode shortcut: | 78 // Information about the App Mode shortcut: |
| 79 | 79 |
| 80 // Path to the App Mode Loader application bundle that launched the process. | 80 // Path to the App Mode Loader application bundle that launched the process. |
| 81 FilePath app_mode_bundle_path; // Optional: v1.0 | 81 FilePath app_mode_bundle_path; // Optional: v1.0 |
| 82 | 82 |
| 83 // 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 |
| 84 // safe for the file system. | 84 // safe for the file system. |
| 85 std::string app_mode_id; // Required: v1.0 | 85 std::string app_mode_id; // Required: v1.0 |
| 86 | 86 |
| 87 // Short (e.g., one-word) UTF8-encoded name for the shortcut. | |
| 88 string16 app_mode_short_name; // Optional: v1.0 | |
| 89 | |
| 90 // Unrestricted (e.g., several-word) UTF8-encoded name for the shortcut. | 87 // Unrestricted (e.g., several-word) UTF8-encoded name for the shortcut. |
| 91 string16 app_mode_name; // Optional: v1.0 | 88 string16 app_mode_name; // Optional: v1.0 |
| 92 | 89 |
| 93 // URL for the shortcut. Must be a valid URL. | 90 // URL for the shortcut. Must be a valid URL. |
| 94 std::string app_mode_url; // Required: v1.0 | 91 std::string app_mode_url; // Required: v1.0 |
| 95 | 92 |
| 96 // Path to the app's user data directory. | 93 // Path to the app's user data directory. |
| 97 FilePath user_data_dir; | 94 FilePath user_data_dir; |
| 98 | 95 |
| 99 // Path to the app's extension. | 96 // Path to the app's extension. |
| 100 FilePath extension_path; | 97 FilePath extension_path; |
| 101 }; | 98 }; |
| 102 | 99 |
| 103 } // namespace app_mode | 100 } // namespace app_mode |
| 104 | 101 |
| 105 #endif // CHROME_COMMON_MAC_APP_MODE_COMMON_H_ | 102 #endif // CHROME_COMMON_MAC_APP_MODE_COMMON_H_ |
| OLD | NEW |