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__ | |
Ilya Sherman
2014/06/14 01:18:51
Why is this header ever included on non-Mac platfo
erikchen
2014/06/16 20:30:46
I don't know?
| |
16 | 16 |
17 namespace keystone_glue { | |
Ilya Sherman
2014/06/14 01:18:51
Why is this namespace needed?
Ilya Sherman
2014/06/14 01:18:51
nit: Please leave a blank line after this one...
erikchen
2014/06/16 20:30:46
Done (adding vertical whitespace). I could not fin
erikchen
2014/06/16 20:30:46
I was under the impression that there is a style g
| |
17 // Possible outcomes of various operations. A version may accompany some of | 18 // 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 | 19 // 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. | 20 // accompanied by a version, the comment indicates what version is referenced. |
20 // A notification posted containing an asynchronous status will always be | 21 // A notification posted containing an asynchronous status will always be |
21 // followed by a notification with a terminal status. | 22 // followed by a notification with a terminal status. |
22 enum AutoupdateStatus { | 23 enum AutoupdateStatus { |
23 kAutoupdateNone = 0, // no version (initial state only) | 24 kAutoupdateNone = 0, // no version (initial state only) |
24 kAutoupdateRegistering, // no version (asynchronous operation in progress) | 25 kAutoupdateRegistering, // no version (asynchronous operation in progress) |
25 kAutoupdateRegistered, // no version | 26 kAutoupdateRegistered, // no version |
26 kAutoupdateChecking, // no version (asynchronous operation in progress) | 27 kAutoupdateChecking, // no version (asynchronous operation in progress) |
27 kAutoupdateCurrent, // version of the running application | 28 kAutoupdateCurrent, // version of the running application |
28 kAutoupdateAvailable, // version of the update that is available | 29 kAutoupdateAvailable, // version of the update that is available |
29 kAutoupdateInstalling, // no version (asynchronous operation in progress) | 30 kAutoupdateInstalling, // no version (asynchronous operation in progress) |
30 kAutoupdateInstalled, // version of the update that was installed | 31 kAutoupdateInstalled, // version of the update that was installed |
31 kAutoupdatePromoting, // no version (asynchronous operation in progress) | 32 kAutoupdatePromoting, // no version (asynchronous operation in progress) |
32 kAutoupdatePromoted, // no version | 33 kAutoupdatePromoted, // no version |
33 kAutoupdateRegisterFailed, // no version | 34 kAutoupdateRegisterFailed, // no version |
34 kAutoupdateCheckFailed, // no version | 35 kAutoupdateCheckFailed, // no version |
35 kAutoupdateInstallFailed, // no version | 36 kAutoupdateInstallFailed, // no version |
36 kAutoupdatePromoteFailed, // no version | 37 kAutoupdatePromoteFailed, // no version |
37 kAutoupdateNeedsPromotion, // no version | 38 kAutoupdateNeedsPromotion, // no version |
38 }; | 39 }; |
40 } // namespace keystone_glue | |
Ilya Sherman
2014/06/14 01:18:51
nit: ... and before this one.
erikchen
2014/06/16 20:30:46
Done.
| |
41 | |
42 #if defined(__OBJC__) | |
39 | 43 |
40 // kAutoupdateStatusNotification is the name of the notification posted when | 44 // kAutoupdateStatusNotification is the name of the notification posted when |
41 // -checkForUpdate and -installUpdate complete. This notification will be | 45 // -checkForUpdate and -installUpdate complete. This notification will be sent |
42 // sent with with its sender object set to the KeystoneGlue instance sending | 46 // with with its sender object set to the KeystoneGlue instance sending the |
43 // the notification. Its userInfo dictionary will contain an AutoupdateStatus | 47 // notification. Its userInfo dictionary will contain an AutoupdateStatus |
44 // value as an intValue at key kAutoupdateStatusStatus. If a version is | 48 // value as an intValue at key kAutoupdateStatusStatus. If a version is |
45 // available (see AutoupdateStatus), it will be present at key | 49 // available (see AutoupdateStatus), it will be present at key |
46 // kAutoupdateStatusVersion. | 50 // kAutoupdateStatusVersion. This notification is always posted on the main |
51 // thread. | |
47 extern NSString* const kAutoupdateStatusNotification; | 52 extern NSString* const kAutoupdateStatusNotification; |
48 extern NSString* const kAutoupdateStatusStatus; | 53 extern NSString* const kAutoupdateStatusStatus; |
49 extern NSString* const kAutoupdateStatusVersion; | 54 extern NSString* const kAutoupdateStatusVersion; |
50 | 55 |
51 namespace { | 56 namespace { |
52 | 57 |
53 enum BrandFileType { | 58 enum BrandFileType { |
54 kBrandFileTypeNotDetermined = 0, | 59 kBrandFileTypeNotDetermined = 0, |
55 kBrandFileTypeNone, | 60 kBrandFileTypeNone, |
56 kBrandFileTypeUser, | 61 kBrandFileTypeUser, |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
115 // a kAutoupdateStatusNotification notification, and will also be available | 120 // a kAutoupdateStatusNotification notification, and will also be available |
116 // through -recentNotification. | 121 // through -recentNotification. |
117 - (void)checkForUpdate; | 122 - (void)checkForUpdate; |
118 - (void)installUpdate; | 123 - (void)installUpdate; |
119 | 124 |
120 // Accessor for recentNotification_. Returns an autoreleased NSNotification. | 125 // Accessor for recentNotification_. Returns an autoreleased NSNotification. |
121 - (NSNotification*)recentNotification; | 126 - (NSNotification*)recentNotification; |
122 | 127 |
123 // Accessor for the kAutoupdateStatusStatus field of recentNotification_'s | 128 // Accessor for the kAutoupdateStatusStatus field of recentNotification_'s |
124 // userInfo dictionary. | 129 // userInfo dictionary. |
125 - (AutoupdateStatus)recentStatus; | 130 - (keystone_glue::AutoupdateStatus)recentStatus; |
126 | 131 |
127 // Returns YES if an asynchronous operation is pending: if an update check or | 132 // Returns YES if an asynchronous operation is pending: if an update check or |
128 // installation attempt is currently in progress. | 133 // installation attempt is currently in progress. |
129 - (BOOL)asyncOperationPending; | 134 - (BOOL)asyncOperationPending; |
130 | 135 |
131 // Returns YES if the application is running from a read-only filesystem, | 136 // Returns YES if the application is running from a read-only filesystem, |
132 // such as a disk image. | 137 // such as a disk image. |
133 - (BOOL)isOnReadOnlyFilesystem; | 138 - (BOOL)isOnReadOnlyFilesystem; |
134 | 139 |
135 // -needsPromotion is YES if the application needs its ticket promoted to | 140 // -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 | 210 |
206 // True if Keystone is enabled. | 211 // True if Keystone is enabled. |
207 bool KeystoneEnabled(); | 212 bool KeystoneEnabled(); |
208 | 213 |
209 // The version of the application currently installed on disk. | 214 // The version of the application currently installed on disk. |
210 base::string16 CurrentlyInstalledVersion(); | 215 base::string16 CurrentlyInstalledVersion(); |
211 | 216 |
212 } // namespace keystone_glue | 217 } // namespace keystone_glue |
213 | 218 |
214 #endif // CHROME_BROWSER_MAC_KEYSTONE_GLUE_H_ | 219 #endif // CHROME_BROWSER_MAC_KEYSTONE_GLUE_H_ |
OLD | NEW |