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

Side by Side Diff: base/mac_util.mm

Issue 194007: Breakpad about:crash crashing browser (oops) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 11 years, 3 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 | Annotate | Revision Log
« 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) 2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2008 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 "base/mac_util.h" 5 #include "base/mac_util.h"
6 6
7 #import <Cocoa/Cocoa.h> 7 #import <Cocoa/Cocoa.h>
8 8
9 #include "base/file_path.h" 9 #include "base/file_path.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 26 matching lines...) Expand all
37 FSCatalogInfo info; 37 FSCatalogInfo info;
38 if (FSGetCatalogInfo(&fsref, kFSCatInfoNodeFlags, &info, 38 if (FSGetCatalogInfo(&fsref, kFSCatInfoNodeFlags, &info,
39 NULL, NULL, NULL) != noErr) { 39 NULL, NULL, NULL) != noErr) {
40 return false; 40 return false;
41 } 41 }
42 42
43 return info.nodeFlags & kFSNodeIsDirectoryMask; 43 return info.nodeFlags & kFSNodeIsDirectoryMask;
44 } 44 }
45 45
46 bool IsBackgroundOnlyProcess() { 46 bool IsBackgroundOnlyProcess() {
47 NSBundle* main_bundle = MainAppBundle(); 47 // This function really does want to examine NSBundle's idea of the main
48 NSDictionary* info_dictionary = [main_bundle infoDictionary]; 48 // bundle dictionary, and not the overriden MainAppBundle. It needs to look
49 // at the actual running .app's Info.plist to access its LSUIElement
50 // property.
51 NSDictionary* info_dictionary = [[NSBundle mainBundle] infoDictionary];
49 return [[info_dictionary objectForKey:@"LSUIElement"] boolValue] != NO; 52 return [[info_dictionary objectForKey:@"LSUIElement"] boolValue] != NO;
50 } 53 }
51 54
52 // No threading worries since NSBundle isn't thread safe. 55 // No threading worries since NSBundle isn't thread safe.
53 static NSBundle* g_override_app_bundle = nil; 56 static NSBundle* g_override_app_bundle = nil;
54 57
55 NSBundle* MainAppBundle() { 58 NSBundle* MainAppBundle() {
56 if (g_override_app_bundle) 59 if (g_override_app_bundle)
57 return g_override_app_bundle; 60 return g_override_app_bundle;
58 return [NSBundle mainBundle]; 61 return [NSBundle mainBundle];
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 NSString* library_dir = [dirs objectAtIndex:0]; 99 NSString* library_dir = [dirs objectAtIndex:0];
97 const char* library_dir_path = [library_dir fileSystemRepresentation]; 100 const char* library_dir_path = [library_dir fileSystemRepresentation];
98 if (!library_dir_path) 101 if (!library_dir_path)
99 return FilePath(); 102 return FilePath();
100 103
101 return FilePath(library_dir_path); 104 return FilePath(library_dir_path);
102 } 105 }
103 106
104 107
105 } // namespace mac_util 108 } // namespace mac_util
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