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_BROWSER_MAC_KEYSTONE_GLUE_H_ | 5 #ifndef CHROME_BROWSER_MAC_KEYSTONE_GLUE_H_ |
6 #define CHROME_BROWSER_MAC_KEYSTONE_GLUE_H_ | 6 #define CHROME_BROWSER_MAC_KEYSTONE_GLUE_H_ |
7 | 7 |
8 #include "base/strings/string16.h" | 8 #include "base/strings/string16.h" |
9 | 9 |
10 #if defined(__OBJC__) | 10 #if defined(__OBJC__) |
11 | |
12 #import <Foundation/Foundation.h> | 11 #import <Foundation/Foundation.h> |
13 | 12 |
14 #include "base/mac/scoped_authorizationref.h" | 13 #include "base/mac/scoped_authorizationref.h" |
15 #import "base/mac/scoped_nsobject.h" | 14 #import "base/mac/scoped_nsobject.h" |
15 #endif // __OBJC__ | |
16 | |
17 namespace keystone_glue { | |
16 | 18 |
17 // Possible outcomes of various operations. A version may accompany some of | 19 // Possible outcomes of various operations. A version may accompany some of |
18 // these, but beware: a version is never required. For statuses that can be | 20 // these, but beware: a version is never required. For statuses that can be |
19 // accompanied by a version, the comment indicates what version is referenced. | 21 // accompanied by a version, the comment indicates what version is referenced. |
20 // A notification posted containing an asynchronous status will always be | 22 // A notification posted containing an asynchronous status will always be |
21 // followed by a notification with a terminal status. | 23 // followed by a notification with a terminal status. |
22 enum AutoupdateStatus { | 24 enum AutoupdateStatus { |
23 kAutoupdateNone = 0, // no version (initial state only) | 25 kAutoupdateNone = 0, // no version (initial state only) |
24 kAutoupdateRegistering, // no version (asynchronous operation in progress) | 26 kAutoupdateRegistering, // no version (asynchronous operation in progress) |
25 kAutoupdateRegistered, // no version | 27 kAutoupdateRegistered, // no version |
26 kAutoupdateChecking, // no version (asynchronous operation in progress) | 28 kAutoupdateChecking, // no version (asynchronous operation in progress) |
27 kAutoupdateCurrent, // version of the running application | 29 kAutoupdateCurrent, // version of the running application |
28 kAutoupdateAvailable, // version of the update that is available | 30 kAutoupdateAvailable, // version of the update that is available |
29 kAutoupdateInstalling, // no version (asynchronous operation in progress) | 31 kAutoupdateInstalling, // no version (asynchronous operation in progress) |
30 kAutoupdateInstalled, // version of the update that was installed | 32 kAutoupdateInstalled, // version of the update that was installed |
31 kAutoupdatePromoting, // no version (asynchronous operation in progress) | 33 kAutoupdatePromoting, // no version (asynchronous operation in progress) |
32 kAutoupdatePromoted, // no version | 34 kAutoupdatePromoted, // no version |
33 kAutoupdateRegisterFailed, // no version | 35 kAutoupdateRegisterFailed, // no version |
34 kAutoupdateCheckFailed, // no version | 36 kAutoupdateCheckFailed, // no version |
35 kAutoupdateInstallFailed, // no version | 37 kAutoupdateInstallFailed, // no version |
36 kAutoupdatePromoteFailed, // no version | 38 kAutoupdatePromoteFailed, // no version |
37 kAutoupdateNeedsPromotion, // no version | 39 kAutoupdateNeedsPromotion, // no version |
38 }; | 40 }; |
39 | 41 |
42 } // namespace keystone_glue | |
Ilya Sherman
2014/06/17 19:55:01
I would prefer not to add this namespace as part o
erikchen
2014/06/17 22:36:06
I have reverted the namespace change, and well as
| |
43 | |
44 #if defined(__OBJC__) | |
45 | |
40 // kAutoupdateStatusNotification is the name of the notification posted when | 46 // kAutoupdateStatusNotification is the name of the notification posted when |
41 // -checkForUpdate and -installUpdate complete. This notification will be | 47 // -checkForUpdate and -installUpdate complete. This notification will be sent |
42 // sent with with its sender object set to the KeystoneGlue instance sending | 48 // with with its sender object set to the KeystoneGlue instance sending the |
43 // the notification. Its userInfo dictionary will contain an AutoupdateStatus | 49 // notification. Its userInfo dictionary will contain an AutoupdateStatus |
44 // value as an intValue at key kAutoupdateStatusStatus. If a version is | 50 // value as an intValue at key kAutoupdateStatusStatus. If a version is |
45 // available (see AutoupdateStatus), it will be present at key | 51 // available (see AutoupdateStatus), it will be present at key |
46 // kAutoupdateStatusVersion. | 52 // kAutoupdateStatusVersion. This notification is always posted on the main |
53 // thread. | |
47 extern NSString* const kAutoupdateStatusNotification; | 54 extern NSString* const kAutoupdateStatusNotification; |
48 extern NSString* const kAutoupdateStatusStatus; | 55 extern NSString* const kAutoupdateStatusStatus; |
49 extern NSString* const kAutoupdateStatusVersion; | 56 extern NSString* const kAutoupdateStatusVersion; |
50 | 57 |
51 namespace { | 58 namespace { |
52 | 59 |
53 enum BrandFileType { | 60 enum BrandFileType { |
54 kBrandFileTypeNotDetermined = 0, | 61 kBrandFileTypeNotDetermined = 0, |
55 kBrandFileTypeNone, | 62 kBrandFileTypeNone, |
56 kBrandFileTypeUser, | 63 kBrandFileTypeUser, |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
115 // a kAutoupdateStatusNotification notification, and will also be available | 122 // a kAutoupdateStatusNotification notification, and will also be available |
116 // through -recentNotification. | 123 // through -recentNotification. |
117 - (void)checkForUpdate; | 124 - (void)checkForUpdate; |
118 - (void)installUpdate; | 125 - (void)installUpdate; |
119 | 126 |
120 // Accessor for recentNotification_. Returns an autoreleased NSNotification. | 127 // Accessor for recentNotification_. Returns an autoreleased NSNotification. |
121 - (NSNotification*)recentNotification; | 128 - (NSNotification*)recentNotification; |
122 | 129 |
123 // Accessor for the kAutoupdateStatusStatus field of recentNotification_'s | 130 // Accessor for the kAutoupdateStatusStatus field of recentNotification_'s |
124 // userInfo dictionary. | 131 // userInfo dictionary. |
125 - (AutoupdateStatus)recentStatus; | 132 - (keystone_glue::AutoupdateStatus)recentStatus; |
126 | 133 |
127 // Returns YES if an asynchronous operation is pending: if an update check or | 134 // Returns YES if an asynchronous operation is pending: if an update check or |
128 // installation attempt is currently in progress. | 135 // installation attempt is currently in progress. |
129 - (BOOL)asyncOperationPending; | 136 - (BOOL)asyncOperationPending; |
130 | 137 |
131 // Returns YES if the application is running from a read-only filesystem, | 138 // Returns YES if the application is running from a read-only filesystem, |
132 // such as a disk image. | 139 // such as a disk image. |
133 - (BOOL)isOnReadOnlyFilesystem; | 140 - (BOOL)isOnReadOnlyFilesystem; |
134 | 141 |
135 // -needsPromotion is YES if the application needs its ticket promoted to | 142 // -needsPromotion is YES if the application needs its ticket promoted to |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
205 | 212 |
206 // True if Keystone is enabled. | 213 // True if Keystone is enabled. |
207 bool KeystoneEnabled(); | 214 bool KeystoneEnabled(); |
208 | 215 |
209 // The version of the application currently installed on disk. | 216 // The version of the application currently installed on disk. |
210 base::string16 CurrentlyInstalledVersion(); | 217 base::string16 CurrentlyInstalledVersion(); |
211 | 218 |
212 } // namespace keystone_glue | 219 } // namespace keystone_glue |
213 | 220 |
214 #endif // CHROME_BROWSER_MAC_KEYSTONE_GLUE_H_ | 221 #endif // CHROME_BROWSER_MAC_KEYSTONE_GLUE_H_ |
OLD | NEW |