| 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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 if (path_components.empty()) | 109 if (path_components.empty()) |
| 110 return false; | 110 return false; |
| 111 // The first path component is special because it may be absolute. Calling | 111 // The first path component is special because it may be absolute. Calling |
| 112 // Append with an absolute path component will trigger an assert, so we | 112 // Append with an absolute path component will trigger an assert, so we |
| 113 // must handle it differently and initialize output with it. | 113 // must handle it differently and initialize output with it. |
| 114 *output = base::FilePath(path_components[0]); | 114 *output = base::FilePath(path_components[0]); |
| 115 // Append next path components untill we find the *.app component. When we do, | 115 // Append next path components untill we find the *.app component. When we do, |
| 116 // append Contents/MacOS. | 116 // append Contents/MacOS. |
| 117 for (size_t i = 1; i < path_components.size(); ++i) { | 117 for (size_t i = 1; i < path_components.size(); ++i) { |
| 118 *output = output->Append(path_components[i]); | 118 *output = output->Append(path_components[i]); |
| 119 if (base::EndsWith(path_components[i], ".app", | 119 if (base::EndsWith(path_components[i], ".app", true)) { |
| 120 base::CompareCase::SENSITIVE)) { | |
| 121 *output = output->Append("Contents"); | 120 *output = output->Append("Contents"); |
| 122 *output = output->Append("MacOS"); | 121 *output = output->Append("MacOS"); |
| 123 return true; | 122 return true; |
| 124 } | 123 } |
| 125 } | 124 } |
| 126 LOG(ERROR) << path_from_file << " doesn't look like a valid Firefox " | 125 LOG(ERROR) << path_from_file << " doesn't look like a valid Firefox " |
| 127 << "installation path: missing /*.app/ directory."; | 126 << "installation path: missing /*.app/ directory."; |
| 128 return false; | 127 return false; |
| 129 } | 128 } |
| 130 #endif // OS_MACOSX | 129 #endif // OS_MACOSX |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 321 } | 320 } |
| 322 } | 321 } |
| 323 } | 322 } |
| 324 } | 323 } |
| 325 | 324 |
| 326 base::StringToLowerASCII(&branding_name); | 325 base::StringToLowerASCII(&branding_name); |
| 327 if (branding_name.find("iceweasel") != std::string::npos) | 326 if (branding_name.find("iceweasel") != std::string::npos) |
| 328 return l10n_util::GetStringUTF16(IDS_IMPORT_FROM_ICEWEASEL); | 327 return l10n_util::GetStringUTF16(IDS_IMPORT_FROM_ICEWEASEL); |
| 329 return l10n_util::GetStringUTF16(IDS_IMPORT_FROM_FIREFOX); | 328 return l10n_util::GetStringUTF16(IDS_IMPORT_FROM_FIREFOX); |
| 330 } | 329 } |
| OLD | NEW |