| 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 "net/ftp/ftp_directory_listing_parser_vms.h" | 5 #include "net/ftp/ftp_directory_listing_parser_vms.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/string_number_conversions.h" | 9 #include "base/string_number_conversions.h" |
| 10 #include "base/string_split.h" | 10 #include "base/string_split.h" |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 | 117 |
| 118 bool LooksLikeVmsUserIdentificationCode(const string16& input) { | 118 bool LooksLikeVmsUserIdentificationCode(const string16& input) { |
| 119 if (input.length() < 2) | 119 if (input.length() < 2) |
| 120 return false; | 120 return false; |
| 121 return input[0] == '[' && input[input.length() - 1] == ']'; | 121 return input[0] == '[' && input[input.length() - 1] == ']'; |
| 122 } | 122 } |
| 123 | 123 |
| 124 bool LooksLikePermissionDeniedError(const string16& text) { | 124 bool LooksLikePermissionDeniedError(const string16& text) { |
| 125 static const char* kPermissionDeniedMessages[] = { | 125 static const char* kPermissionDeniedMessages[] = { |
| 126 "%RMS-E-PRV", | 126 "%RMS-E-PRV", |
| 127 "%SYSTEM-F-NOPRIV", |
| 127 "privilege", | 128 "privilege", |
| 128 }; | 129 }; |
| 129 | 130 |
| 130 for (size_t i = 0; i < arraysize(kPermissionDeniedMessages); i++) { | 131 for (size_t i = 0; i < arraysize(kPermissionDeniedMessages); i++) { |
| 131 if (text.find(ASCIIToUTF16(kPermissionDeniedMessages[i])) != string16::npos) | 132 if (text.find(ASCIIToUTF16(kPermissionDeniedMessages[i])) != string16::npos) |
| 132 return true; | 133 return true; |
| 133 } | 134 } |
| 134 | 135 |
| 135 return false; | 136 return false; |
| 136 } | 137 } |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 | 257 |
| 257 entries->push_back(entry); | 258 entries->push_back(entry); |
| 258 } | 259 } |
| 259 | 260 |
| 260 // The only place where we return true is after receiving the "Total" line, | 261 // The only place where we return true is after receiving the "Total" line, |
| 261 // that should be present in every VMS listing. | 262 // that should be present in every VMS listing. |
| 262 return false; | 263 return false; |
| 263 } | 264 } |
| 264 | 265 |
| 265 } // namespace net | 266 } // namespace net |
| OLD | NEW |