15821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Copyright (c) 2012 The Chromium Authors. All rights reserved.
25821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be
35821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// found in the LICENSE file.
45821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
55821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#ifndef CHROME_BROWSER_MAC_KEYSTONE_GLUE_H_
65821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#define CHROME_BROWSER_MAC_KEYSTONE_GLUE_H_
75821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
8868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)#include "base/strings/string16.h"
95821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#if defined(__OBJC__)
115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#import <Foundation/Foundation.h>
135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "base/mac/scoped_authorizationref.h"
15eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch#import "base/mac/scoped_nsobject.h"
165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Possible outcomes of various operations.  A version may accompany some of
185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// these, but beware: a version is never required.  For statuses that can be
195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// accompanied by a version, the comment indicates what version is referenced.
205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// A notification posted containing an asynchronous status will always be
215821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// followed by a notification with a terminal status.
225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)enum AutoupdateStatus {
235821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  kAutoupdateNone = 0,        // no version (initial state only)
245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  kAutoupdateRegistering,     // no version (asynchronous operation in progress)
255821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  kAutoupdateRegistered,      // no version
265821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  kAutoupdateChecking,        // no version (asynchronous operation in progress)
275821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  kAutoupdateCurrent,         // version of the running application
285821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  kAutoupdateAvailable,       // version of the update that is available
295821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  kAutoupdateInstalling,      // no version (asynchronous operation in progress)
305821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  kAutoupdateInstalled,       // version of the update that was installed
315821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  kAutoupdatePromoting,       // no version (asynchronous operation in progress)
325821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  kAutoupdatePromoted,        // no version
335821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  kAutoupdateRegisterFailed,  // no version
345821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  kAutoupdateCheckFailed,     // no version
355821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  kAutoupdateInstallFailed,   // no version
365821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  kAutoupdatePromoteFailed,   // no version
375821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  kAutoupdateNeedsPromotion,  // no version
385821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)};
395821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
405821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// kAutoupdateStatusNotification is the name of the notification posted when
415821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// -checkForUpdate and -installUpdate complete.  This notification will be
425821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// sent with with its sender object set to the KeystoneGlue instance sending
435821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// the notification.  Its userInfo dictionary will contain an AutoupdateStatus
445821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// value as an intValue at key kAutoupdateStatusStatus.  If a version is
455821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// available (see AutoupdateStatus), it will be present at key
465821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// kAutoupdateStatusVersion.
475821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)extern NSString* const kAutoupdateStatusNotification;
485821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)extern NSString* const kAutoupdateStatusStatus;
495821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)extern NSString* const kAutoupdateStatusVersion;
505821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
515821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)namespace {
525821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
535821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)enum BrandFileType {
545821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  kBrandFileTypeNotDetermined = 0,
555821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  kBrandFileTypeNone,
565821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  kBrandFileTypeUser,
575821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  kBrandFileTypeSystem,
585821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)};
595821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
605821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)} // namespace
615821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
625821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// KeystoneGlue is an adapter around the KSRegistration class, allowing it to
635821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// be used without linking directly against its containing KeystoneRegistration
645821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// framework.  This is used in an environment where most builds (such as
655821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// developer builds) don't want or need Keystone support and might not even
665821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// have the framework available.  Enabling Keystone support in an application
675821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// that uses KeystoneGlue is as simple as dropping
685821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// KeystoneRegistration.framework in the application's Frameworks directory
695821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// and providing the relevant information in its Info.plist.  KeystoneGlue
705821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// requires that the KSUpdateURL key be set in the application's Info.plist,
715821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// and that it contain a string identifying the update URL to be used by
725821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Keystone.
735821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
745821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)@class KSRegistration;
755821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
765821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)@interface KeystoneGlue : NSObject {
775821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) @protected
785821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
795821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Data for Keystone registration
805821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  NSString* productID_;
815821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  NSString* appPath_;
825821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  NSString* url_;
835821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  NSString* version_;
845821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  NSString* channel_;  // Logically: Dev, Beta, or Stable.
855821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  BrandFileType brandFileType_;
865821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
875821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // And the Keystone registration itself, with the active timer
885821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  KSRegistration* registration_;  // strong
895821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  NSTimer* timer_;  // strong
905821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
915821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // The most recent kAutoupdateStatusNotification notification posted.
92eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch  base::scoped_nsobject<NSNotification> recentNotification_;
935821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
945821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // The authorization object, when it needs to persist because it's being
955821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // carried across threads.
965821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  base::mac::ScopedAuthorizationRef authorization_;
975821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
985821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // YES if a synchronous promotion operation is in progress (promotion during
995821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // installation).
1005821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  BOOL synchronousPromotion_;
1015821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1025821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // YES if an update was ever successfully installed by -installUpdate.
1035821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  BOOL updateSuccessfullyInstalled_;
1045821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)}
1055821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1065821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Return the default Keystone Glue object.
1075821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)+ (id)defaultKeystoneGlue;
1085821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1095821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Load KeystoneRegistration.framework if present, call into it to register
1105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// with Keystone, and set up periodic activity pings.
1115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)- (void)registerWithKeystone;
1125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// -checkForUpdate launches a check for updates, and -installUpdate begins
1145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// installing an available update.  For each, status will be communicated via
1155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// a kAutoupdateStatusNotification notification, and will also be available
1165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// through -recentNotification.
1175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)- (void)checkForUpdate;
1185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)- (void)installUpdate;
1195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Accessor for recentNotification_.  Returns an autoreleased NSNotification.
1215821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)- (NSNotification*)recentNotification;
1225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1235821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Accessor for the kAutoupdateStatusStatus field of recentNotification_'s
1245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// userInfo dictionary.
1255821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)- (AutoupdateStatus)recentStatus;
1265821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1275821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Returns YES if an asynchronous operation is pending: if an update check or
1285821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// installation attempt is currently in progress.
1295821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)- (BOOL)asyncOperationPending;
1305821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1315821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Returns YES if the application is running from a read-only filesystem,
1325821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// such as a disk image.
1335821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)- (BOOL)isOnReadOnlyFilesystem;
1345821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1355821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// -needsPromotion is YES if the application needs its ticket promoted to
1365821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// a system ticket.  This will be YES when the application is on a user
1375821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// ticket and determines that the current user does not have sufficient
1385821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// permission to perform the update.
1395821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)//
1405821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// -wantsPromotion is YES if the application wants its ticket promoted to
1415821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// a system ticket, even if it doesn't need it as determined by
1425821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// -needsPromotion.  -wantsPromotion will always be YES if -needsPromotion is,
1435821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// and it will additionally be YES when the application is on a user ticket
1445821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// and appears to be installed in a system-wide location such as
1455821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// /Applications.
1465821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)//
1475821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Use -needsPromotion to decide whether to show any update UI at all.  If
1485821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// it's YES, there's no sense in asking the user to "update now" because it
1495821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// will fail given the rights and permissions involved.  On the other hand,
1505821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// when -needsPromotion is YES, the application can encourage the user to
1515821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// promote the ticket so that updates will work properly.
1525821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)//
1535821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Use -wantsPromotion to decide whether to allow the user to promote.  The
1545821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// user shouldn't be nagged about promotion on the basis of -wantsPromotion,
1555821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// but if it's YES, the user should be allowed to promote the ticket.
1565821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)- (BOOL)needsPromotion;
1575821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)- (BOOL)wantsPromotion;
1585821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1595821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Promotes the Keystone ticket into the system store.  System Keystone will
1605821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// be installed if necessary.  If synchronous is NO, the promotion may occur
1615821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// in the background.  synchronous should be YES for promotion during
1625821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// installation. The KeystoneGlue object assumes ownership of
1635821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// authorization_arg.
1645821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)- (void)promoteTicketWithAuthorization:(AuthorizationRef)authorization_arg
1655821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                           synchronous:(BOOL)synchronous;
1665821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1675821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Requests authorization and calls -promoteTicketWithAuthorization: in
1685821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// asynchronous mode.
1695821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)- (void)promoteTicket;
1705821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1715821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Sets a new value for appPath.  Used during installation to point a ticket
1725821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// at the installed copy.
1735821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)- (void)setAppPath:(NSString*)appPath;
1745821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1755821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)@end  // @interface KeystoneGlue
1765821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1775821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)@interface KeystoneGlue(ExposedForTesting)
1785821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1795821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Load any params we need for configuring Keystone.
1805821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)- (void)loadParameters;
1815821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1825821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Load the Keystone registration object.
1835821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Return NO on failure.
1845821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)- (BOOL)loadKeystoneRegistration;
1855821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1865821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)- (void)stopTimer;
1875821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1885821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Called when a checkForUpdate: notification completes.
1895821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)- (void)checkForUpdateComplete:(NSNotification*)notification;
1905821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1915821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Called when an installUpdate: notification completes.
1925821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)- (void)installUpdateComplete:(NSNotification*)notification;
1935821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1945821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)@end  // @interface KeystoneGlue(ExposedForTesting)
1955821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1965821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#endif  // __OBJC__
1975821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1985821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Functions that may be accessed from non-Objective-C C/C++ code.
1995821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)namespace keystone_glue {
2005821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2015821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Returns the brand code of the installation. Note that beta, dev, and canary
2025821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// channels, as well as some stable builds, may have an empty string as a brand
2035821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// code.
2045821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)std::string BrandCode();
2055821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2065821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// True if Keystone is enabled.
2075821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)bool KeystoneEnabled();
2085821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2095821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// The version of the application currently installed on disk.
2105d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)base::string16 CurrentlyInstalledVersion();
2115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)}  // namespace keystone_glue
2135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#endif  // CHROME_BROWSER_MAC_KEYSTONE_GLUE_H_
215