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

Side by Side Diff: chrome/installer/gcapi_mac/gcapi.mm

Issue 2145723002: gcapi_mac: Support installation on macOS 10.12 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "chrome/installer/gcapi_mac/gcapi.h" 5 #include "chrome/installer/gcapi_mac/gcapi.h"
6 6
7 #import <Cocoa/Cocoa.h> 7 #import <Cocoa/Cocoa.h>
8 #include <grp.h> 8 #include <grp.h>
9 #include <pwd.h> 9 #include <pwd.h>
10 #include <stddef.h> 10 #include <stddef.h>
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 51
52 int darwin_major_version = atoi(uname_info.release); 52 int darwin_major_version = atoi(uname_info.release);
53 if (darwin_major_version < 6) 53 if (darwin_major_version < 6)
54 return false; 54 return false;
55 55
56 // The Darwin major version is always 4 greater than the Mac OS X minor 56 // The Darwin major version is always 4 greater than the Mac OS X minor
57 // version for Darwin versions beginning with 6, corresponding to Mac OS X 57 // version for Darwin versions beginning with 6, corresponding to Mac OS X
58 // 10.2. 58 // 10.2.
59 int mac_os_x_minor_version = darwin_major_version - 4; 59 int mac_os_x_minor_version = darwin_major_version - 4;
60 60
61 // Chrome is known to work on 10.9 - 10.11. 61 // Chrome is known to work on 10.9 - 10.12.
62 return mac_os_x_minor_version >= 9 && mac_os_x_minor_version <= 11; 62 return mac_os_x_minor_version >= 9 && mac_os_x_minor_version <= 12;
63 } 63 }
64 64
65 // Returns the pid/gid of the logged-in user, even if getuid() claims that the 65 // Returns the pid/gid of the logged-in user, even if getuid() claims that the
66 // current user is root. 66 // current user is root.
67 // Returns NULL on error. 67 // Returns NULL on error.
68 passwd* GetRealUserId() { 68 passwd* GetRealUserId() {
69 CFDictionaryRef session_info_dict = CGSessionCopyCurrentDictionary(); 69 CFDictionaryRef session_info_dict = CGSessionCopyCurrentDictionary();
70 [NSMakeCollectable(session_info_dict) autorelease]; 70 [NSMakeCollectable(session_info_dict) autorelease];
71 if (!session_info_dict) 71 if (!session_info_dict)
72 return NULL; // Possibly no screen plugged in. 72 return NULL; // Possibly no screen plugged in.
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after
453 else if (FindChromeTicket(kSystemTicket, NULL, &path) && path) 453 else if (FindChromeTicket(kSystemTicket, NULL, &path) && path)
454 app_path = path; 454 app_path = path;
455 else 455 else
456 app_path = kChromeInstallPath; 456 app_path = kChromeInstallPath;
457 457
458 // NSWorkspace launches processes as the current console owner, 458 // NSWorkspace launches processes as the current console owner,
459 // even when running with euid of 0. 459 // even when running with euid of 0.
460 return [[NSWorkspace sharedWorkspace] launchApplication:app_path]; 460 return [[NSWorkspace sharedWorkspace] launchApplication:app_path];
461 } 461 }
462 } 462 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698