| 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/browser/importer/firefox_importer_utils.h" | 5 #include "chrome/browser/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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 }; | 49 }; |
| 50 } // namespace | 50 } // namespace |
| 51 | 51 |
| 52 base::FilePath GetFirefoxProfilePath() { | 52 base::FilePath GetFirefoxProfilePath() { |
| 53 DictionaryValue root; | 53 DictionaryValue root; |
| 54 base::FilePath ini_file = GetProfilesINI(); | 54 base::FilePath ini_file = GetProfilesINI(); |
| 55 ParseProfileINI(ini_file, &root); | 55 ParseProfileINI(ini_file, &root); |
| 56 | 56 |
| 57 base::FilePath source_path; | 57 base::FilePath source_path; |
| 58 for (int i = 0; ; ++i) { | 58 for (int i = 0; ; ++i) { |
| 59 std::string current_profile = StringPrintf("Profile%d", i); | 59 std::string current_profile = base::StringPrintf("Profile%d", i); |
| 60 if (!root.HasKey(current_profile)) { | 60 if (!root.HasKey(current_profile)) { |
| 61 // Profiles are continuously numbered. So we exit when we can't | 61 // Profiles are continuously numbered. So we exit when we can't |
| 62 // find the i-th one. | 62 // find the i-th one. |
| 63 break; | 63 break; |
| 64 } | 64 } |
| 65 std::string is_relative; | 65 std::string is_relative; |
| 66 string16 path16; | 66 string16 path16; |
| 67 if (root.GetStringASCII(current_profile + ".IsRelative", &is_relative) && | 67 if (root.GetStringASCII(current_profile + ".IsRelative", &is_relative) && |
| 68 root.GetString(current_profile + ".Path", &path16)) { | 68 root.GetString(current_profile + ".Path", &path16)) { |
| 69 #if defined(OS_WIN) | 69 #if defined(OS_WIN) |
| (...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 459 } | 459 } |
| 460 } | 460 } |
| 461 } | 461 } |
| 462 } | 462 } |
| 463 | 463 |
| 464 StringToLowerASCII(&branding_name); | 464 StringToLowerASCII(&branding_name); |
| 465 if (branding_name.find("iceweasel") != std::string::npos) | 465 if (branding_name.find("iceweasel") != std::string::npos) |
| 466 return l10n_util::GetStringUTF16(IDS_IMPORT_FROM_ICEWEASEL); | 466 return l10n_util::GetStringUTF16(IDS_IMPORT_FROM_ICEWEASEL); |
| 467 return l10n_util::GetStringUTF16(IDS_IMPORT_FROM_FIREFOX); | 467 return l10n_util::GetStringUTF16(IDS_IMPORT_FROM_FIREFOX); |
| 468 } | 468 } |
| OLD | NEW |