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

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

Issue 18501013: Move most importer code to chrome/utility/importer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: another gyp attempt Created 7 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include <Cocoa/Cocoa.h>
6 #include <sys/param.h>
7
8 #include "chrome/browser/importer/firefox_importer_utils.h"
9
10 #include "base/file_util.h"
11 #include "base/mac/foundation_util.h"
12 #include "base/path_service.h"
13
14 base::FilePath GetProfilesINI() {
15 base::FilePath app_data_path;
16 if (!PathService::Get(base::DIR_APP_DATA, &app_data_path)) {
17 return base::FilePath();
18 }
19 base::FilePath ini_file =
20 app_data_path.Append("Firefox").Append("profiles.ini");
21 if (!base::PathExists(ini_file)) {
22 return base::FilePath();
23 }
24 return ini_file;
25 }
26
27 base::FilePath GetFirefoxDylibPath() {
28 CFURLRef appURL = nil;
29 if (LSFindApplicationForInfo(kLSUnknownCreator,
30 CFSTR("org.mozilla.firefox"),
31 NULL,
32 NULL,
33 &appURL) != noErr) {
34 return base::FilePath();
35 }
36 NSBundle *ff_bundle =
37 [NSBundle bundleWithPath:[base::mac::CFToNSCast(appURL) path]];
38 CFRelease(appURL);
39 NSString *ff_library_path =
40 [[ff_bundle executablePath] stringByDeletingLastPathComponent];
41 char buf[MAXPATHLEN];
42 if (![ff_library_path getFileSystemRepresentation:buf maxLength:sizeof(buf)])
43 return base::FilePath();
44 return base::FilePath(buf);
45 }
OLDNEW
« no previous file with comments | « chrome/browser/importer/firefox_importer_utils_linux.cc ('k') | chrome/browser/importer/firefox_importer_utils_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698