Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/base/filename_util.h" | 5 #include "net/base/filename_util.h" |
| 6 | 6 |
| 7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
| 8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
| 9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 128 | 128 |
| 129 for (size_t i = 0; i < arraysize(known_devices); ++i) { | 129 for (size_t i = 0; i < arraysize(known_devices); ++i) { |
| 130 // Exact match. | 130 // Exact match. |
| 131 if (filename_lower == known_devices[i]) | 131 if (filename_lower == known_devices[i]) |
| 132 return true; | 132 return true; |
| 133 // Starts with "DEVICE.". | 133 // Starts with "DEVICE.". |
| 134 if (filename_lower.find(std::string(known_devices[i]) + ".") == 0) | 134 if (filename_lower.find(std::string(known_devices[i]) + ".") == 0) |
| 135 return true; | 135 return true; |
| 136 } | 136 } |
| 137 | 137 |
| 138 static const char* const magic_names[] = { | 138 static const char* const magic_names[] = {// These file names are used by the |
| 139 // These file names are used by the "Customize folder" feature of the shell. | 139 // "Customize folder" feature of the |
| 140 "desktop.ini", | 140 // shell. |
| 141 "thumbs.db", | 141 "desktop.ini", |
| 142 "thumbs.db", | |
|
Ryan Sleevi
2014/10/11 02:04:47
Probably worth a bug here.
jkarlin
2014/10/16 00:19:32
Issued. https://code.google.com/p/chromium/issues/
jkarlin
2014/11/11 19:01:43
This one was supposed to have been fixed but isn't
jkarlin
2014/11/11 19:34:48
Okay, fixed upstream in clang-format r221699 but w
| |
| 142 }; | 143 }; |
| 143 | 144 |
| 144 for (size_t i = 0; i < arraysize(magic_names); ++i) { | 145 for (size_t i = 0; i < arraysize(magic_names); ++i) { |
| 145 if (filename_lower == magic_names[i]) | 146 if (filename_lower == magic_names[i]) |
| 146 return true; | 147 return true; |
| 147 } | 148 } |
| 148 | 149 |
| 149 return false; | 150 return false; |
| 150 } | 151 } |
| 151 | 152 |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 311 base::FilePath generated_name( | 312 base::FilePath generated_name( |
| 312 base::SysWideToNativeMB(base::UTF16ToWide(file_name))); | 313 base::SysWideToNativeMB(base::UTF16ToWide(file_name))); |
| 313 #endif | 314 #endif |
| 314 | 315 |
| 315 DCHECK(!generated_name.empty()); | 316 DCHECK(!generated_name.empty()); |
| 316 | 317 |
| 317 return generated_name; | 318 return generated_name; |
| 318 } | 319 } |
| 319 | 320 |
| 320 } // namespace net | 321 } // namespace net |
| OLD | NEW |