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

Side by Side Diff: chrome/browser/importer/firefox_importer_utils_mac.mm

Issue 174206: Bring up Firefox Password Import Unittest on OS X. (Closed)
Patch Set: Small fix Created 11 years, 4 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
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 <Cocoa/Cocoa.h> 5 #include <Cocoa/Cocoa.h>
6 6
7 #include "chrome/browser/importer/firefox_importer_utils.h" 7 #include "chrome/browser/importer/firefox_importer_utils.h"
8 8
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 10
11 FilePath GetProfilesINI() { 11 FilePath GetProfilesINI() {
12 FilePath ini_file; 12 FilePath ini_file;
13 NSArray* dirs = 13 NSArray* dirs =
14 NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, 14 NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory,
15 NSUserDomainMask, YES); 15 NSUserDomainMask, YES);
16 if ([dirs count]) { 16 if ([dirs count]) {
17 NSString* app_support_dir = [dirs objectAtIndex:0]; 17 NSString* app_support_dir = [dirs objectAtIndex:0];
18 NSString* firefox_dir = [app_support_dir 18 NSString* firefox_dir = [app_support_dir
19 stringByAppendingPathComponent:@"Firefox"]; 19 stringByAppendingPathComponent:@"Firefox"];
20 NSString* profiles_ini = [firefox_dir 20 NSString* profiles_ini = [firefox_dir
21 stringByAppendingPathComponent:@"profiles.ini"]; 21 stringByAppendingPathComponent:@"profiles.ini"];
22 if (profiles_ini) { 22 if (profiles_ini) {
23 ini_file = FilePath([profiles_ini fileSystemRepresentation]); 23 ini_file = FilePath([profiles_ini fileSystemRepresentation]);
24 } 24 }
25 } 25 }
26 26
27 if (file_util::PathExists(ini_file)) 27 if (file_util::PathExists(ini_file))
28 return ini_file; 28 return ini_file;
29 29
30 return FilePath(); 30 return FilePath();
31 } 31 }
32
33 bool GetFirefoxDylibPath(FilePath *ff_dylib_dir) {
34 CFURLRef appURL = nil;
35 if (LSFindApplicationForInfo(kLSUnknownCreator,
36 CFSTR("org.mozilla.firefox"),
37 NULL,
38 NULL,
39 &appURL) != noErr) {
40 return false;
41 }
42 NSBundle *ff_bundle = [NSBundle
43 bundleWithPath:[reinterpret_cast<const NSURL*>(appURL) path]];
44 CFRelease(appURL);
45 NSString *ff_library_path = [ff_bundle bundlePath];
46
47 // Get the path to the MACOS directory.
48 ff_library_path = [ff_library_path
John Grabowski 2009/08/21 01:13:18 [[NSBundle executablePath] stringByDeletingLastPat
49 stringByAppendingPathComponent:@"Contents"];
50 ff_library_path = [ff_library_path stringByAppendingPathComponent:@"MacOS"];
51
52 *ff_dylib_dir = FilePath([ff_library_path fileSystemRepresentation]);
53 return true;
54 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698