| 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 |
| 35 // When the Chrome browser is run, it stores it's location in the defaults |
| 36 // system using this key. |
| 37 extern NSString* const kLastRunAppBundlePathPrefsKey; |
| 38 |
| 39 // Placeholder used in the Info.plist, meant to be replaced by the extension |
| 40 // shortcut ID. |
| 41 extern NSString* const kShortcutIdPlaceholder; |
| 42 |
| 39 // Current major/minor version numbers of |ChromeAppModeInfo| (defined below). | 43 // Current major/minor version numbers of |ChromeAppModeInfo| (defined below). |
| 40 const unsigned kCurrentChromeAppModeInfoMajorVersion = 1; | 44 const unsigned kCurrentChromeAppModeInfoMajorVersion = 1; |
| 41 const unsigned kCurrentChromeAppModeInfoMinorVersion = 0; | 45 const unsigned kCurrentChromeAppModeInfoMinorVersion = 0; |
| 42 | 46 |
| 43 // The structure used to pass information from the app mode loader to the | 47 // The structure used to pass information from the app mode loader to the |
| 44 // (browser) framework. This is versioned using major and minor version numbers, | 48 // (browser) framework. This is versioned using major and minor version numbers, |
| 45 // written below as v<major>.<minor>. Version-number checking is done by the | 49 // written below as v<major>.<minor>. Version-number checking is done by the |
| 46 // framework, and the framework must accept all structures with the same major | 50 // framework, and the framework must accept all structures with the same major |
| 47 // version number. It may refuse to load if the major version of the structure | 51 // version number. It may refuse to load if the major version of the structure |
| 48 // is different from the one it accepts. | 52 // is different from the one it accepts. |
| 49 struct ChromeAppModeInfo { | 53 struct ChromeAppModeInfo { |
| 50 public: | 54 public: |
| 51 ChromeAppModeInfo(); | 55 ChromeAppModeInfo(); |
| 52 ~ChromeAppModeInfo(); | 56 ~ChromeAppModeInfo(); |
| 53 | 57 |
| 54 // Major and minor version number of this structure. | 58 // Major and minor version number of this structure. |
| 55 unsigned major_version; // Required: all versions | 59 unsigned major_version; // Required: all versions |
| 56 unsigned minor_version; // Required: all versions | 60 unsigned minor_version; // Required: all versions |
| 57 | 61 |
| 58 // Original |argc| and |argv|. | 62 // Original |argc| and |argv|. |
| 59 int argc; // Required: v1.0 | 63 int argc; // Required: v1.0 |
| 60 char** argv; // Required: v1.0 | 64 char** argv; // Required: v1.0 |
| 61 | 65 |
| 62 // Versioned path to the browser which is being loaded. | 66 // Versioned path to the browser which is being loaded. |
| 63 FilePath chrome_versioned_path; // Required: v1.0 | 67 FilePath chrome_versioned_path; // Required: v1.0 |
| 64 | 68 |
| 69 // Path to Chrome app bundle. |
| 70 FilePath chrome_outer_bundle_path; // Required: v1.0 |
| 71 |
| 65 // Information about the App Mode shortcut: | 72 // Information about the App Mode shortcut: |
| 66 | 73 |
| 67 // Path to the App Mode Loader application bundle originally run. | 74 // Path to the App Mode Loader application bundle that launched the process. |
| 68 FilePath app_mode_bundle_path; // Optional: v1.0 | 75 FilePath app_mode_bundle_path; // Optional: v1.0 |
| 69 | 76 |
| 70 // Short ID string, preferably derived from |app_mode_short_name|. Should be | 77 // Short ID string, preferably derived from |app_mode_short_name|. Should be |
| 71 // safe for the file system. | 78 // safe for the file system. |
| 72 std::string app_mode_id; // Required: v1.0 | 79 std::string app_mode_id; // Required: v1.0 |
| 73 | 80 |
| 74 // Short (e.g., one-word) UTF8-encoded name for the shortcut. | 81 // Short (e.g., one-word) UTF8-encoded name for the shortcut. |
| 75 string16 app_mode_short_name; // Optional: v1.0 | 82 string16 app_mode_short_name; // Optional: v1.0 |
| 76 | 83 |
| 77 // Unrestricted (e.g., several-word) UTF8-encoded name for the shortcut. | 84 // Unrestricted (e.g., several-word) UTF8-encoded name for the shortcut. |
| 78 string16 app_mode_name; // Optional: v1.0 | 85 string16 app_mode_name; // Optional: v1.0 |
| 79 | 86 |
| 80 // URL for the shortcut. Must be a valid URL. | 87 // URL for the shortcut. Must be a valid URL. |
| 81 std::string app_mode_url; // Required: v1.0 | 88 std::string app_mode_url; // Optional: v1.0 |
| 82 }; | 89 }; |
| 83 | 90 |
| 84 } // namespace app_mode | 91 } // namespace app_mode |
| 85 | 92 |
| 86 #endif // CHROME_COMMON_MAC_APP_MODE_COMMON_H_ | 93 #endif // CHROME_COMMON_MAC_APP_MODE_COMMON_H_ |
| OLD | NEW |