Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(13)

Side by Side Diff: chrome/browser/mac/keystone_glue.mm

Issue 2583743002: Add mac-only "Set Up Automatic Updates..." button to the new about page. (Closed)
Patch Set: add back nullptr check Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/mac/keystone_glue.h" 5 #import "chrome/browser/mac/keystone_glue.h"
6 6
7 #include <sys/mount.h> 7 #include <sys/mount.h>
8 #include <sys/param.h> 8 #include <sys/param.h>
9 #include <sys/stat.h> 9 #include <sys/stat.h>
10 10
(...skipping 819 matching lines...) Expand 10 before | Expand all | Expand 10 after
830 830
831 if (statfs(appPathC, &statfsBuf) != 0) { 831 if (statfs(appPathC, &statfsBuf) != 0) {
832 PLOG(ERROR) << "statfs"; 832 PLOG(ERROR) << "statfs";
833 // Be optimistic about the filesystem's writability. 833 // Be optimistic about the filesystem's writability.
834 return NO; 834 return NO;
835 } 835 }
836 836
837 return (statfsBuf.f_flags & MNT_RDONLY) != 0; 837 return (statfsBuf.f_flags & MNT_RDONLY) != 0;
838 } 838 }
839 839
840 - (BOOL)isAutoupdateEnabledForAllUsers {
841 return [self isSystemKeystone] && ![self isUserTicket];
842 }
843
840 - (BOOL)needsPromotion { 844 - (BOOL)needsPromotion {
841 // Don't promote when on a read-only filesystem. 845 // Don't promote when on a read-only filesystem.
842 if ([self isOnReadOnlyFilesystem]) { 846 if ([self isOnReadOnlyFilesystem]) {
843 return NO; 847 return NO;
844 } 848 }
845 849
846 // Promotion is required when a system ticket is present but system Keystone 850 // Promotion is required when a system ticket is present but system Keystone
847 // is not. 851 // is not.
848 if ([self isSystemTicketDoomed]) { 852 if ([self isSystemTicketDoomed]) {
849 return YES; 853 return YES;
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after
1195 return [KeystoneGlue defaultKeystoneGlue] != nil; 1199 return [KeystoneGlue defaultKeystoneGlue] != nil;
1196 } 1200 }
1197 1201
1198 base::string16 CurrentlyInstalledVersion() { 1202 base::string16 CurrentlyInstalledVersion() {
1199 KeystoneGlue* keystoneGlue = [KeystoneGlue defaultKeystoneGlue]; 1203 KeystoneGlue* keystoneGlue = [KeystoneGlue defaultKeystoneGlue];
1200 NSString* version = [keystoneGlue currentlyInstalledVersion]; 1204 NSString* version = [keystoneGlue currentlyInstalledVersion];
1201 return base::SysNSStringToUTF16(version); 1205 return base::SysNSStringToUTF16(version);
1202 } 1206 }
1203 1207
1204 } // namespace keystone_glue 1208 } // namespace keystone_glue
OLDNEW
« no previous file with comments | « chrome/browser/mac/keystone_glue.h ('k') | chrome/browser/resources/settings/about_page/about_page.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698