OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2013 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 "chrome/common/importer/safari_importer_utils.h" | |
6 | |
7 #include "base/file_util.h" | |
8 #include "chrome/common/importer/importer_data_types.h" | |
9 | |
10 bool SafariImporterCanImport(const base::FilePath& library_dir, | |
11 uint16* services_supported) { | |
12 DCHECK(services_supported); | |
13 *services_supported = importer::NONE; | |
14 | |
15 // Import features are toggled by the following: | |
16 // bookmarks import: existence of ~/Library/Safari/Bookmarks.plist file. | |
17 // history import: existence of ~/Library/Safari/History.plist file. | |
18 base::FilePath safari_dir = library_dir.Append("Safari"); | |
gab
2013/07/16 14:18:06
include file_path.h
scottmg
2013/07/16 16:11:33
Done.
| |
19 base::FilePath bookmarks_path = safari_dir.Append("Bookmarks.plist"); | |
20 base::FilePath history_path = safari_dir.Append("History.plist"); | |
21 | |
22 if (base::PathExists(bookmarks_path)) | |
23 *services_supported |= importer::FAVORITES; | |
24 if (base::PathExists(history_path)) | |
25 *services_supported |= importer::HISTORY; | |
26 | |
27 return *services_supported != importer::NONE; | |
28 } | |
OLD | NEW |