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

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

Issue 625593002: Support installation on Mac OS X 10.10 under gcapi (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 <sys/stat.h> 10 #include <sys/stat.h>
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 50
51 int darwin_major_version = atoi(uname_info.release); 51 int darwin_major_version = atoi(uname_info.release);
52 if (darwin_major_version < 6) 52 if (darwin_major_version < 6)
53 return false; 53 return false;
54 54
55 // The Darwin major version is always 4 greater than the Mac OS X minor 55 // The Darwin major version is always 4 greater than the Mac OS X minor
56 // version for Darwin versions beginning with 6, corresponding to Mac OS X 56 // version for Darwin versions beginning with 6, corresponding to Mac OS X
57 // 10.2. 57 // 10.2.
58 int mac_os_x_minor_version = darwin_major_version - 4; 58 int mac_os_x_minor_version = darwin_major_version - 4;
59 59
60 // Chrome is known to work on 10.6 - 10.9. 60 // Chrome is known to work on 10.6 - 10.10.
61 return mac_os_x_minor_version >= 6 && mac_os_x_minor_version <= 9; 61 return mac_os_x_minor_version >= 6 && mac_os_x_minor_version <= 10;
62 } 62 }
63 63
64 // Returns the pid/gid of the logged-in user, even if getuid() claims that the 64 // Returns the pid/gid of the logged-in user, even if getuid() claims that the
65 // current user is root. 65 // current user is root.
66 // Returns NULL on error. 66 // Returns NULL on error.
67 passwd* GetRealUserId() { 67 passwd* GetRealUserId() {
68 CFDictionaryRef session_info_dict = CGSessionCopyCurrentDictionary(); 68 CFDictionaryRef session_info_dict = CGSessionCopyCurrentDictionary();
69 [NSMakeCollectable(session_info_dict) autorelease]; 69 [NSMakeCollectable(session_info_dict) autorelease];
70 if (!session_info_dict) 70 if (!session_info_dict)
71 return NULL; // Possibly no screen plugged in. 71 return NULL; // Possibly no screen plugged in.
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after
452 else if (FindChromeTicket(kSystemTicket, NULL, &path) && path) 452 else if (FindChromeTicket(kSystemTicket, NULL, &path) && path)
453 app_path = path; 453 app_path = path;
454 else 454 else
455 app_path = kChromeInstallPath; 455 app_path = kChromeInstallPath;
456 456
457 // NSWorkspace launches processes as the current console owner, 457 // NSWorkspace launches processes as the current console owner,
458 // even when running with euid of 0. 458 // even when running with euid of 0.
459 return [[NSWorkspace sharedWorkspace] launchApplication:app_path]; 459 return [[NSWorkspace sharedWorkspace] launchApplication:app_path];
460 } 460 }
461 } 461 }
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