| OLD | NEW | 
|---|
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 #import "chrome/browser/cocoa/keystone_glue.h" | 5 #import "chrome/browser/cocoa/keystone_glue.h" | 
| 6 | 6 | 
| 7 #include <sys/param.h> | 7 #include <sys/param.h> | 
| 8 #include <sys/mount.h> | 8 #include <sys/mount.h> | 
| 9 | 9 | 
| 10 #include <vector> | 10 #include <vector> | 
| (...skipping 14 matching lines...) Expand all  Loading... | 
| 25 typedef enum { | 25 typedef enum { | 
| 26   kKSPathExistenceChecker, | 26   kKSPathExistenceChecker, | 
| 27 } KSExistenceCheckerType; | 27 } KSExistenceCheckerType; | 
| 28 | 28 | 
| 29 typedef enum { | 29 typedef enum { | 
| 30   kKSRegistrationUserTicket, | 30   kKSRegistrationUserTicket, | 
| 31   kKSRegistrationSystemTicket, | 31   kKSRegistrationSystemTicket, | 
| 32   kKSRegistrationDontKnowWhatKindOfTicket, | 32   kKSRegistrationDontKnowWhatKindOfTicket, | 
| 33 } KSRegistrationTicketType; | 33 } KSRegistrationTicketType; | 
| 34 | 34 | 
| 35 NSString* KSRegistrationVersionKey = @"Version"; | 35 NSString* const KSRegistrationVersionKey = @"Version"; | 
| 36 NSString* KSRegistrationExistenceCheckerTypeKey = @"ExistenceCheckerType"; | 36 NSString* const KSRegistrationExistenceCheckerTypeKey = @"ExistenceCheckerType"; | 
| 37 NSString* KSRegistrationExistenceCheckerStringKey = @"ExistenceCheckerString"; | 37 NSString* const KSRegistrationExistenceCheckerStringKey = | 
| 38 NSString* KSRegistrationServerURLStringKey = @"URLString"; | 38     @"ExistenceCheckerString"; | 
| 39 NSString* KSRegistrationPreserveTrustedTesterTokenKey = @"PreserveTTT"; | 39 NSString* const KSRegistrationServerURLStringKey = @"URLString"; | 
| 40 NSString* KSRegistrationTagKey = @"Tag"; | 40 NSString* const KSRegistrationPreserveTrustedTesterTokenKey = @"PreserveTTT"; | 
| 41 NSString* KSRegistrationTagPathKey = @"TagPath"; | 41 NSString* const KSRegistrationTagKey = @"Tag"; | 
| 42 NSString* KSRegistrationTagKeyKey = @"TagKey"; | 42 NSString* const KSRegistrationTagPathKey = @"TagPath"; | 
| 43 NSString* KSRegistrationBrandPathKey = @"BrandPath"; | 43 NSString* const KSRegistrationTagKeyKey = @"TagKey"; | 
| 44 NSString* KSRegistrationBrandKeyKey = @"BrandKey"; | 44 NSString* const KSRegistrationBrandPathKey = @"BrandPath"; | 
|  | 45 NSString* const KSRegistrationBrandKeyKey = @"BrandKey"; | 
| 45 | 46 | 
| 46 NSString *KSRegistrationDidCompleteNotification = | 47 NSString* const KSRegistrationDidCompleteNotification = | 
| 47     @"KSRegistrationDidCompleteNotification"; | 48     @"KSRegistrationDidCompleteNotification"; | 
| 48 NSString *KSRegistrationPromotionDidCompleteNotification = | 49 NSString* const KSRegistrationPromotionDidCompleteNotification = | 
| 49     @"KSRegistrationPromotionDidCompleteNotification"; | 50     @"KSRegistrationPromotionDidCompleteNotification"; | 
| 50 | 51 | 
| 51 NSString *KSRegistrationCheckForUpdateNotification = | 52 NSString* const KSRegistrationCheckForUpdateNotification = | 
| 52     @"KSRegistrationCheckForUpdateNotification"; | 53     @"KSRegistrationCheckForUpdateNotification"; | 
| 53 NSString *KSRegistrationStatusKey = @"Status"; | 54 NSString* KSRegistrationStatusKey = @"Status"; | 
| 54 NSString *KSRegistrationUpdateCheckErrorKey = @"Error"; | 55 NSString* KSRegistrationUpdateCheckErrorKey = @"Error"; | 
| 55 | 56 | 
| 56 NSString *KSRegistrationStartUpdateNotification = | 57 NSString* const KSRegistrationStartUpdateNotification = | 
| 57     @"KSRegistrationStartUpdateNotification"; | 58     @"KSRegistrationStartUpdateNotification"; | 
| 58 NSString *KSUpdateCheckSuccessfulKey = @"CheckSuccessful"; | 59 NSString* const KSUpdateCheckSuccessfulKey = @"CheckSuccessful"; | 
| 59 NSString *KSUpdateCheckSuccessfullyInstalledKey = @"SuccessfullyInstalled"; | 60 NSString* const KSUpdateCheckSuccessfullyInstalledKey = | 
|  | 61     @"SuccessfullyInstalled"; | 
| 60 | 62 | 
| 61 NSString *KSRegistrationRemoveExistingTag = @""; | 63 NSString* const KSRegistrationRemoveExistingTag = @""; | 
| 62 #define KSRegistrationPreserveExistingTag nil | 64 #define KSRegistrationPreserveExistingTag nil | 
| 63 | 65 | 
| 64 // Constants for the brand file (uses an external file so it can survive updates | 66 // Constants for the brand file (uses an external file so it can survive updates | 
| 65 // to Chrome. | 67 // to Chrome. | 
| 66 | 68 | 
| 67 #if defined(GOOGLE_CHROME_BUILD) | 69 #if defined(GOOGLE_CHROME_BUILD) | 
| 68 #define kBrandFileName @"Google Chrome Brand.plist"; | 70 #define kBrandFileName @"Google Chrome Brand.plist"; | 
| 69 #elif defined(CHROMIUM_BUILD) | 71 #elif defined(CHROMIUM_BUILD) | 
| 70 #define kBrandFileName @"Chromium Brand.plist"; | 72 #define kBrandFileName @"Chromium Brand.plist"; | 
| 71 #else | 73 #else | 
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 168 // -changePermissionsForPromotionComplete is called on the main thread. | 170 // -changePermissionsForPromotionComplete is called on the main thread. | 
| 169 - (void)changePermissionsForPromotionAsync; | 171 - (void)changePermissionsForPromotionAsync; | 
| 170 - (void)changePermissionsForPromotionWithTool:(NSString*)toolPath; | 172 - (void)changePermissionsForPromotionWithTool:(NSString*)toolPath; | 
| 171 - (void)changePermissionsForPromotionComplete; | 173 - (void)changePermissionsForPromotionComplete; | 
| 172 | 174 | 
| 173 // Returns the brand file path to use for Keystone. | 175 // Returns the brand file path to use for Keystone. | 
| 174 - (NSString*)brandFilePath; | 176 - (NSString*)brandFilePath; | 
| 175 | 177 | 
| 176 @end  // @interface KeystoneGlue(Private) | 178 @end  // @interface KeystoneGlue(Private) | 
| 177 | 179 | 
| 178 const NSString* const kAutoupdateStatusNotification = | 180 NSString* const kAutoupdateStatusNotification = @"AutoupdateStatusNotification"; | 
| 179     @"AutoupdateStatusNotification"; | 181 NSString* const kAutoupdateStatusStatus = @"status"; | 
| 180 const NSString* const kAutoupdateStatusStatus = @"status"; | 182 NSString* const kAutoupdateStatusVersion = @"version"; | 
| 181 const NSString* const kAutoupdateStatusVersion = @"version"; |  | 
| 182 | 183 | 
| 183 namespace { | 184 namespace { | 
| 184 | 185 | 
| 185 const NSString* const kChannelKey = @"KSChannelID"; | 186 NSString* const kChannelKey = @"KSChannelID"; | 
| 186 const NSString* const kBrandKey = @"KSBrandID"; | 187 NSString* const kBrandKey = @"KSBrandID"; | 
| 187 | 188 | 
| 188 }  // namespace | 189 }  // namespace | 
| 189 | 190 | 
| 190 @implementation KeystoneGlue | 191 @implementation KeystoneGlue | 
| 191 | 192 | 
| 192 + (id)defaultKeystoneGlue { | 193 + (id)defaultKeystoneGlue { | 
| 193   static bool sTriedCreatingDefaultKeystoneGlue = false; | 194   static bool sTriedCreatingDefaultKeystoneGlue = false; | 
| 194   // TODO(jrg): use base::SingletonObjC<KeystoneGlue> | 195   // TODO(jrg): use base::SingletonObjC<KeystoneGlue> | 
| 195   static KeystoneGlue* sDefaultKeystoneGlue = nil;  // leaked | 196   static KeystoneGlue* sDefaultKeystoneGlue = nil;  // leaked | 
| 196 | 197 | 
| (...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 890 } | 891 } | 
| 891 | 892 | 
| 892 - (void)setAppPath:(NSString*)appPath { | 893 - (void)setAppPath:(NSString*)appPath { | 
| 893   if (appPath != appPath_) { | 894   if (appPath != appPath_) { | 
| 894     [appPath_ release]; | 895     [appPath_ release]; | 
| 895     appPath_ = [appPath copy]; | 896     appPath_ = [appPath copy]; | 
| 896   } | 897   } | 
| 897 } | 898 } | 
| 898 | 899 | 
| 899 @end  // @implementation KeystoneGlue | 900 @end  // @implementation KeystoneGlue | 
| OLD | NEW | 
|---|