Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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_REGISTRATION_H_ | 5 #ifndef CHROME_BROWSER_MAC_KEYSTONE_REGISTRATION_H_ |
| 6 #define CHROME_BROWSER_MAC_KEYSTONE_REGISTRATION_H_ | 6 #define CHROME_BROWSER_MAC_KEYSTONE_REGISTRATION_H_ |
| 7 | 7 |
| 8 #import <Foundation/Foundation.h> | 8 #import <Foundation/Foundation.h> |
| 9 #include <Security/Authorization.h> | 9 #include <Security/Authorization.h> |
| 10 | 10 |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 41 | 41 |
| 42 extern NSString* KSRegistrationCheckForUpdateNotification; | 42 extern NSString* KSRegistrationCheckForUpdateNotification; |
| 43 extern NSString* KSRegistrationStatusKey; | 43 extern NSString* KSRegistrationStatusKey; |
| 44 extern NSString* KSRegistrationUpdateCheckErrorKey; | 44 extern NSString* KSRegistrationUpdateCheckErrorKey; |
| 45 | 45 |
| 46 extern NSString* KSRegistrationStartUpdateNotification; | 46 extern NSString* KSRegistrationStartUpdateNotification; |
| 47 extern NSString* KSUpdateCheckSuccessfulKey; | 47 extern NSString* KSUpdateCheckSuccessfulKey; |
| 48 extern NSString* KSUpdateCheckSuccessfullyInstalledKey; | 48 extern NSString* KSUpdateCheckSuccessfullyInstalledKey; |
| 49 | 49 |
| 50 extern NSString* KSRegistrationRemoveExistingTag; | 50 extern NSString* KSRegistrationRemoveExistingTag; |
| 51 | |
| 52 extern NSString* KSReportingAttributeValueKey; | |
| 53 extern NSString* KSReportingAttributeExpirationDateKey; | |
| 54 extern NSString* KSReportingAttributeAggregationTypeKey; | |
| 51 #define KSRegistrationPreserveExistingTag nil | 55 #define KSRegistrationPreserveExistingTag nil |
| 52 | 56 |
| 53 } // namespace keystone_registration | 57 } // namespace keystone_registration |
| 54 | 58 |
| 59 typedef enum { | |
| 60 kKSReportingAggregationSum = 0, // Adds attribute value across user accounts | |
| 61 kKSReportingAggregationDefault = kKSReportingAggregationSum, | |
| 62 } KSReportingAggregationType; | |
| 63 | |
| 55 @interface KSRegistration : NSObject | 64 @interface KSRegistration : NSObject |
| 56 | 65 |
| 57 + (id)registrationWithProductID:(NSString*)productID; | 66 + (id)registrationWithProductID:(NSString*)productID; |
| 58 | 67 |
| 59 - (BOOL)registerWithParameters:(NSDictionary*)args; | 68 - (BOOL)registerWithParameters:(NSDictionary*)args; |
| 60 | 69 |
| 61 - (BOOL)promoteWithParameters:(NSDictionary*)args | 70 - (BOOL)promoteWithParameters:(NSDictionary*)args |
| 62 authorization:(AuthorizationRef)authorization; | 71 authorization:(AuthorizationRef)authorization; |
| 63 | 72 |
| 64 - (BOOL)setActive; | 73 - (BOOL)setActive; |
| 74 - (BOOL)setActiveWithReportingAttributes:(NSArray*)reportingAttributes | |
| 75 error:(NSError**)error; | |
| 65 - (void)checkForUpdateWasUserInitiated:(BOOL)userInitiated; | 76 - (void)checkForUpdateWasUserInitiated:(BOOL)userInitiated; |
| 66 - (void)startUpdate; | 77 - (void)startUpdate; |
| 67 - (keystone_registration::KSRegistrationTicketType)ticketType; | 78 - (keystone_registration::KSRegistrationTicketType)ticketType; |
| 68 | 79 |
| 69 @end // @interface KSRegistration | 80 @end // @interface KSRegistration |
| 70 | 81 |
| 82 | |
| 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 | |
| 87 | |
| 88 @end // @interface KSReportingAttribute | |
| 89 | |
| 90 /* | |
|
Mark Mentovai
2015/02/20 21:54:19
We don’t need to copy any of the documentation. Se
Mike Lerman
2015/02/23 16:12:11
Done. I kept the location of the source file, simi
| |
| 91 * The class holds a single custom reporting attribute of type unsigned integer | |
| 92 * that the application would like to pass during the update server ping. | |
| 93 */ | |
| 94 @interface KSUnsignedReportingAttribute : KSReportingAttribute | |
| 95 | |
| 96 /** | |
| 97 * Creates unsinged reporting attribute using the default lifetime. | |
| 98 * | |
| 99 * @param value The value of the attribute. | |
| 100 * @param name The name of the attribute. | |
| 101 * @param aggregationType In the case of system update engine, attribute values | |
| 102 * are aggregated between users and reported once for the whole machine. This | |
| 103 * parameter controls the aggregationmechinism. | |
| 104 * @see KSReportingAggregationType | |
| 105 * @param error Standard error parameter. | |
| 106 * | |
| 107 * @return Reporting attribute object, holding the specified integer value and | |
| 108 * initialized with the specified properties (name, aggregation type, etc.). In | |
| 109 * case of error, the method returns nil and if @c error is not nil, the method | |
| 110 * sets it accordingly. | |
| 111 */ | |
| 112 + (KSUnsignedReportingAttribute *)reportingAttributeWithValue:(uint32_t)value | |
| 113 name:(NSString *)name | |
| 114 aggregationType:(KSReportingAggregationType)aggregationType | |
| 115 error:(NSError **)error; | |
| 116 | |
| 117 @end // @interface KSUnsignedReportingAttribute | |
| 118 | |
| 119 | |
| 71 #endif // CHROME_BROWSER_MAC_KEYSTONE_REGISTRATION_H_ | 120 #endif // CHROME_BROWSER_MAC_KEYSTONE_REGISTRATION_H_ |
| OLD | NEW |