Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(112)

Side by Side Diff: chrome/common/mac/app_mode_common.h

Issue 9351014: Mac app mode: locate Chrome + refactor (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Misc. fixes Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #include <CoreFoundation/CoreFoundation.h> 9 #include <CoreFoundation/CoreFoundation.h>
10 10
11 #include "base/file_path.h"
12 #include "base/string16.h"
13
11 // This file contains constants, interfaces, etc. which are common to the 14 // This file contains constants, interfaces, etc. which are common to the
12 // browser application and the app mode loader (a.k.a. shim). 15 // browser application and the app mode loader (a.k.a. shim).
13 16
14 namespace app_mode { 17 namespace app_mode {
15 18
16 // 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
17 // app mode launcher bundle's Info.plist. 20 // app mode launcher bundle's Info.plist.
18 extern const CFStringRef kBrowserBundleIDKey; 21 extern const CFStringRef kBrowserBundleIDKey;
19 22
20 // The key under which to record the path to the (user-visible) application 23 // The key under which to record the path to the (user-visible) application
21 // bundle; this key is recorded under the ID given by |kAppPrefsID|. 24 // bundle; this key is recorded under the ID given by |kAppPrefsID|.
22 extern const CFStringRef kLastRunAppBundlePathPrefsKey; 25 extern const CFStringRef kLastRunAppBundlePathPrefsKey;
23 26
24 // Current major/minor version numbers of |ChromeAppModeInfo| (defined below). 27 // Current major/minor version numbers of |ChromeAppModeInfo| (defined below).
25 const unsigned kCurrentChromeAppModeInfoMajorVersion = 1; 28 const unsigned kCurrentChromeAppModeInfoMajorVersion = 1;
26 const unsigned kCurrentChromeAppModeInfoMinorVersion = 0; 29 const unsigned kCurrentChromeAppModeInfoMinorVersion = 0;
27 30
28 // The structure used to pass information from the app mode loader to the 31 // The structure used to pass information from the app mode loader to the
29 // (browser) framework. This is versioned using major and minor version numbers, 32 // (browser) framework. This is versioned using major and minor version numbers,
30 // written below as v<major>.<minor>. Version-number checking is done by the 33 // written below as v<major>.<minor>. Version-number checking is done by the
31 // framework, and the framework must accept all structures with the same major 34 // framework, and the framework must accept all structures with the same major
32 // version number. It may refuse to load if the major version of the structure 35 // version number. It may refuse to load if the major version of the structure
33 // is different from the one it accepts. 36 // is different from the one it accepts.
34 struct ChromeAppModeInfo { 37 struct ChromeAppModeInfo {
Mark Mentovai 2012/02/07 17:28:06 Should this be a class now? Should you provide ge
jeremy 2012/02/09 10:52:51 This code is due for a big refactor, and I'll like
38 public:
39 ChromeAppModeInfo();
40 virtual ~ChromeAppModeInfo();
Mark Mentovai 2012/02/07 17:28:06 There doesn’t appear to be any need for this to be
jeremy 2012/02/09 10:52:51 Done.
41
35 // Major and minor version number of this structure. 42 // Major and minor version number of this structure.
36 unsigned major_version; // Required: all versions 43 unsigned major_version; // Required: all versions
37 unsigned minor_version; // Required: all versions 44 unsigned minor_version; // Required: all versions
38 45
39 // Original |argc| and |argv|. 46 // Original |argc| and |argv|.
40 int argc; // Required: v1.0 47 int argc; // Required: v1.0
Mark Mentovai 2012/02/07 17:28:06 Should these two be a single std::vector<std::stri
jeremy 2012/02/09 10:52:51 See comment above.
41 char** argv; // Required: v1.0 48 char** argv; // Required: v1.0
42 49
43 // Versioned path to the browser which is being loaded. 50 // Versioned path to the browser which is being loaded.
44 char* chrome_versioned_path; // Required: v1.0 51 FilePath chrome_versioned_path; // Required: v1.0
45 52
46 // Information about the App Mode shortcut: 53 // Information about the App Mode shortcut:
47 54
48 // Path to the App Mode Loader application bundle originally run. 55 // Path to the App Mode Loader application bundle originally run.
49 char* app_mode_bundle_path; // Optional: v1.0 56 FilePath app_mode_bundle_path; // Optional: v1.0
50 57
51 // Short ID string, preferably derived from |app_mode_short_name|. Should be 58 // Short ID string, preferably derived from |app_mode_short_name|. Should be
52 // safe for the file system. 59 // safe for the file system.
53 char* app_mode_id; // Required: v1.0 60 std::string app_mode_id; // Required: v1.0
54 61
55 // Short (e.g., one-word) UTF8-encoded name for the shortcut. 62 // Short (e.g., one-word) UTF8-encoded name for the shortcut.
56 char* app_mode_short_name; // Optional: v1.0 63 string16 app_mode_short_name; // Optional: v1.0
57 64
58 // Unrestricted (e.g., several-word) UTF8-encoded name for the shortcut. 65 // Unrestricted (e.g., several-word) UTF8-encoded name for the shortcut.
59 char* app_mode_name; // Optional: v1.0 66 string16 app_mode_name; // Optional: v1.0
60 67
61 // URL for the shortcut. Must be a valid URL. 68 // URL for the shortcut. Must be a valid URL.
62 char* app_mode_url; // Required: v1.0 69 std::string app_mode_url; // Required: v1.0
63 }; 70 };
64 71
65 } // namespace app_mode 72 } // namespace app_mode
66 73
67 #endif // CHROME_COMMON_MAC_APP_MODE_COMMON_H_ 74 #endif // CHROME_COMMON_MAC_APP_MODE_COMMON_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698