OLD | NEW |
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/common/importer/firefox_importer_utils.h" | 5 #include "chrome/common/importer/firefox_importer_utils.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 15 matching lines...) Expand all Loading... |
26 base::FilePath GetProfilePath(const base::DictionaryValue& root, | 26 base::FilePath GetProfilePath(const base::DictionaryValue& root, |
27 const std::string& profile_name) { | 27 const std::string& profile_name) { |
28 base::string16 path16; | 28 base::string16 path16; |
29 std::string is_relative; | 29 std::string is_relative; |
30 if (!root.GetStringASCII(profile_name + ".IsRelative", &is_relative) || | 30 if (!root.GetStringASCII(profile_name + ".IsRelative", &is_relative) || |
31 !root.GetString(profile_name + ".Path", &path16)) | 31 !root.GetString(profile_name + ".Path", &path16)) |
32 return base::FilePath(); | 32 return base::FilePath(); |
33 | 33 |
34 #if defined(OS_WIN) | 34 #if defined(OS_WIN) |
35 ReplaceSubstringsAfterOffset( | 35 ReplaceSubstringsAfterOffset( |
36 &path16, 0, ASCIIToUTF16("/"), ASCIIToUTF16("\\")); | 36 &path16, 0, base::ASCIIToUTF16("/"), base::ASCIIToUTF16("\\")); |
37 #endif | 37 #endif |
38 base::FilePath path = base::FilePath::FromUTF16Unsafe(path16); | 38 base::FilePath path = base::FilePath::FromUTF16Unsafe(path16); |
39 | 39 |
40 // IsRelative=1 means the folder path would be relative to the | 40 // IsRelative=1 means the folder path would be relative to the |
41 // path of profiles.ini. IsRelative=0 refers to a custom profile | 41 // path of profiles.ini. IsRelative=0 refers to a custom profile |
42 // location. | 42 // location. |
43 if (is_relative == "1") | 43 if (is_relative == "1") |
44 path = GetProfilesINI().DirName().Append(path); | 44 path = GetProfilesINI().DirName().Append(path); |
45 | 45 |
46 return path; | 46 return path; |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 } | 277 } |
278 } | 278 } |
279 } | 279 } |
280 } | 280 } |
281 | 281 |
282 StringToLowerASCII(&branding_name); | 282 StringToLowerASCII(&branding_name); |
283 if (branding_name.find("iceweasel") != std::string::npos) | 283 if (branding_name.find("iceweasel") != std::string::npos) |
284 return l10n_util::GetStringUTF16(IDS_IMPORT_FROM_ICEWEASEL); | 284 return l10n_util::GetStringUTF16(IDS_IMPORT_FROM_ICEWEASEL); |
285 return l10n_util::GetStringUTF16(IDS_IMPORT_FROM_FIREFOX); | 285 return l10n_util::GetStringUTF16(IDS_IMPORT_FROM_FIREFOX); |
286 } | 286 } |
OLD | NEW |