OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 <set> | 5 #include <set> |
6 #include <string> | 6 #include <string> |
7 | 7 |
8 #include "chrome/browser/download/download_util.h" | 8 #include "chrome/browser/download/download_util.h" |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "base/string_util.h" |
11 | 12 |
12 namespace download_util { | 13 namespace download_util { |
13 | 14 |
14 // For file extensions taken from mozilla: | 15 // For file extensions taken from mozilla: |
15 | 16 |
16 /* ***** BEGIN LICENSE BLOCK ***** | 17 /* ***** BEGIN LICENSE BLOCK ***** |
17 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 | 18 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 |
18 * | 19 * |
19 * The contents of this file are subject to the Mozilla Public License Version | 20 * The contents of this file are subject to the Mozilla Public License Version |
20 * 1.1 (the "License"); you may not use this file except in compliance with | 21 * 1.1 (the "License"); you may not use this file except in compliance with |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 "pl", | 152 "pl", |
152 "py", | 153 "py", |
153 "rb", | 154 "rb", |
154 "sh", | 155 "sh", |
155 #elif defined(OS_MACOSX) | 156 #elif defined(OS_MACOSX) |
156 // TODO(thakis): Figure out what makes sense here -- crbug.com/19096 | 157 // TODO(thakis): Figure out what makes sense here -- crbug.com/19096 |
157 "dmg", | 158 "dmg", |
158 #endif | 159 #endif |
159 }; | 160 }; |
160 | 161 |
161 void InitializeExeTypes(std::set<std::string>* exe_extensions) { | 162 bool IsExecutableExtension(const std::string& extension) { |
162 DCHECK(exe_extensions); | 163 for (size_t i = 0; i < arraysize(g_executables); ++i) { |
163 for (size_t i = 0; i < arraysize(g_executables); ++i) | 164 if (LowerCaseEqualsASCII(extension, g_executables[i])) |
164 exe_extensions->insert(g_executables[i]); | 165 return true; |
| 166 } |
| 167 return false; |
165 } | 168 } |
166 | 169 |
167 } // namespace download_util | 170 } // namespace download_util |
OLD | NEW |