Only grant permissions to new extensions from sync if they have the expected version
[chromium-blink-merge.git] / chrome / browser / mac / keystone_registration.h
blob3fa9197fa451703fc31358e27041eb0c81f265d7
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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_MAC_KEYSTONE_REGISTRATION_H_
6 #define CHROME_BROWSER_MAC_KEYSTONE_REGISTRATION_H_
8 #import <Foundation/Foundation.h>
9 #include <Security/Authorization.h>
11 // Declarations of the Keystone registration bits needed here. From
12 // KSRegistration.h.
14 namespace keystone_registration {
16 typedef enum {
17 kKSPathExistenceChecker,
18 } KSExistenceCheckerType;
20 typedef enum {
21 kKSRegistrationUserTicket,
22 kKSRegistrationSystemTicket,
23 kKSRegistrationDontKnowWhatKindOfTicket,
24 } KSRegistrationTicketType;
26 extern NSString* KSRegistrationVersionKey;
27 extern NSString* KSRegistrationExistenceCheckerTypeKey;
28 extern NSString* KSRegistrationExistenceCheckerStringKey;
29 extern NSString* KSRegistrationServerURLStringKey;
30 extern NSString* KSRegistrationPreserveTrustedTesterTokenKey;
31 extern NSString* KSRegistrationTagKey;
32 extern NSString* KSRegistrationTagPathKey;
33 extern NSString* KSRegistrationTagKeyKey;
34 extern NSString* KSRegistrationBrandPathKey;
35 extern NSString* KSRegistrationBrandKeyKey;
36 extern NSString* KSRegistrationVersionPathKey;
37 extern NSString* KSRegistrationVersionKeyKey;
39 extern NSString* KSRegistrationDidCompleteNotification;
40 extern NSString* KSRegistrationPromotionDidCompleteNotification;
42 extern NSString* KSRegistrationCheckForUpdateNotification;
43 extern NSString* KSRegistrationStatusKey;
44 extern NSString* KSRegistrationUpdateCheckErrorKey;
46 extern NSString* KSRegistrationStartUpdateNotification;
47 extern NSString* KSUpdateCheckSuccessfulKey;
48 extern NSString* KSUpdateCheckSuccessfullyInstalledKey;
50 extern NSString* KSRegistrationRemoveExistingTag;
52 extern NSString* KSReportingAttributeValueKey;
53 extern NSString* KSReportingAttributeExpirationDateKey;
54 extern NSString* KSReportingAttributeAggregationTypeKey;
55 #define KSRegistrationPreserveExistingTag nil
57 } // namespace keystone_registration
59 typedef enum {
60 kKSReportingAggregationSum = 0, // Adds attribute value across user accounts
61 kKSReportingAggregationDefault = kKSReportingAggregationSum,
62 } KSReportingAggregationType;
64 @interface KSRegistration : NSObject
66 + (id)registrationWithProductID:(NSString*)productID;
68 - (BOOL)registerWithParameters:(NSDictionary*)args;
70 - (BOOL)promoteWithParameters:(NSDictionary*)args
71 authorization:(AuthorizationRef)authorization;
73 - (BOOL)setActive;
74 - (BOOL)setActiveWithReportingAttributes:(NSArray*)reportingAttributes
75 error:(NSError**)error;
76 - (void)checkForUpdateWasUserInitiated:(BOOL)userInitiated;
77 - (void)startUpdate;
78 - (keystone_registration::KSRegistrationTicketType)ticketType;
80 @end // @interface KSRegistration
83 // Declarations of the Keystone attribute reporting bits needed here.
84 // Full definition is at:
85 // //depot/googlemac/opensource/update-engine/Common/KSReportingAttribute.h
86 @interface KSReportingAttribute : NSObject
88 @end // @interface KSReportingAttribute
90 @interface KSUnsignedReportingAttribute : KSReportingAttribute
92 + (KSUnsignedReportingAttribute *)reportingAttributeWithValue:(uint32_t)value
93 name:(NSString *)name
94 aggregationType:(KSReportingAggregationType)aggregationType
95 error:(NSError **)error;
97 @end // @interface KSUnsignedReportingAttribute
100 #endif // CHROME_BROWSER_MAC_KEYSTONE_REGISTRATION_H_