Index: chrome/browser/mac/keystone_registration.h |
diff --git a/chrome/browser/mac/keystone_registration.h b/chrome/browser/mac/keystone_registration.h |
index 056dde1f0b58ada46470544aa54e9735bcfe7cb5..5159796429fd664208225871aca3c18f5a3fcd06 100644 |
--- a/chrome/browser/mac/keystone_registration.h |
+++ b/chrome/browser/mac/keystone_registration.h |
@@ -52,6 +52,12 @@ extern NSString* KSRegistrationRemoveExistingTag; |
} // namespace keystone_registration |
+typedef enum { |
+ kKSReportingAggregationSum = 0, // Adds attribute value across user accounts |
+ |
+ kKSReportingAggregationDefault = kKSReportingAggregationSum, |
+} KSReportingAggregationType; |
+ |
@interface KSRegistration : NSObject |
+ (id)registrationWithProductID:(NSString*)productID; |
@@ -62,10 +68,56 @@ extern NSString* KSRegistrationRemoveExistingTag; |
authorization:(AuthorizationRef)authorization; |
- (BOOL)setActive; |
+- (BOOL)setActiveWithReportingAttributes:(NSArray*)reportingAttributes |
+ error:(NSError**)error; |
- (void)checkForUpdateWasUserInitiated:(BOOL)userInitiated; |
- (void)startUpdate; |
- (keystone_registration::KSRegistrationTicketType)ticketType; |
@end // @interface KSRegistration |
+ |
+// Declarations of the Keystone attribute reporting bits needed here. From |
+// KSReportingAttribute.h. |
+@interface KSReportingAttribute : NSObject |
+ |
+// How long the attribute will live after being set. The clock starts ticking |
+// after the call to setActiveWithReportingAttributes. |
+- (NSTimeInterval)lifetime; |
+- (BOOL)setLifetime:(NSTimeInterval)lifetime error:(NSError **)error; |
+ |
+// The method returns the value stored, as a generic NSObject. Derived classes |
+// accessors provide a more specific data type. |
+- (id<NSObject>)value; |
+ |
+// The name of the attribute. setName checks that the name starts with a letter |
+// and contains only Latin letters, digits and '_', '-'. |
+- (NSString *)name; |
+- (BOOL)setName:(NSString *)name error:(NSError **)error; |
+ |
+// Confirms if a name is correct. Typically called by setName and helper |
+// methods. See "setName" for definition of "correctness". |
++ (BOOL)verifyAttributeName:(NSString *)name error:(NSError **)error; |
+ |
+// Prints information about the attribute. Used for debugging purposes. |
+- (NSString *)description; |
+ |
+@end // @interface KSReportingAttribute |
+ |
+@interface KSUnsignedReportingAttribute : KSReportingAttribute |
+ |
++ (KSUnsignedReportingAttribute *)reportingAttributeWithValue:(uint32_t)value |
+ name:(NSString *)name |
+ aggregationType:(KSReportingAggregationType)aggregationType |
+ error:(NSError **)error; |
+ |
+// Get/set the value of the attribute as "unsigned int" |
+- (uint32_t)unsignedIntValue; |
+- (void)setUnsignedIntValue:(uint32_t)value; |
+ |
+- (KSReportingAggregationType)aggregationType; |
+- (void)setAggregationType:(KSReportingAggregationType)aggregationType; |
+ |
+@end // @interface KSUnsignedReportingAttribute |
+ |
#endif // CHROME_BROWSER_MAC_KEYSTONE_REGISTRATION_H_ |