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 "content/common/plugin_list.h" | 5 #include "content/common/plugin_list.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 mime_type.mime_type = StringToLowerASCII(mime_types[i]); | 146 mime_type.mime_type = StringToLowerASCII(mime_types[i]); |
147 if (file_extensions.size() > i) | 147 if (file_extensions.size() > i) |
148 base::SplitString(file_extensions[i], ',', &mime_type.file_extensions); | 148 base::SplitString(file_extensions[i], ',', &mime_type.file_extensions); |
149 | 149 |
150 if (descriptions.size() > i) { | 150 if (descriptions.size() > i) { |
151 mime_type.description = descriptions[i]; | 151 mime_type.description = descriptions[i]; |
152 | 152 |
153 // On Windows, the description likely has a list of file extensions | 153 // On Windows, the description likely has a list of file extensions |
154 // embedded in it (e.g. "SurfWriter file (*.swr)"). Remove an extension | 154 // embedded in it (e.g. "SurfWriter file (*.swr)"). Remove an extension |
155 // list from the description if it is present. | 155 // list from the description if it is present. |
156 size_t ext = mime_type.description.find(ASCIIToUTF16("(*")); | 156 size_t ext = mime_type.description.find(base::ASCIIToUTF16("(*")); |
157 if (ext != base::string16::npos) { | 157 if (ext != base::string16::npos) { |
158 if (ext > 1 && mime_type.description[ext - 1] == ' ') | 158 if (ext > 1 && mime_type.description[ext - 1] == ' ') |
159 ext--; | 159 ext--; |
160 | 160 |
161 mime_type.description.erase(ext); | 161 mime_type.description.erase(ext); |
162 } | 162 } |
163 } | 163 } |
164 | 164 |
165 parsed_mime_types->push_back(mime_type); | 165 parsed_mime_types->push_back(mime_type); |
166 } | 166 } |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
406 plugin_path); | 406 plugin_path); |
407 if (it != extra_plugin_paths_.end()) | 407 if (it != extra_plugin_paths_.end()) |
408 extra_plugin_paths_.erase(it); | 408 extra_plugin_paths_.erase(it); |
409 } | 409 } |
410 | 410 |
411 PluginList::~PluginList() { | 411 PluginList::~PluginList() { |
412 } | 412 } |
413 | 413 |
414 | 414 |
415 } // namespace content | 415 } // namespace content |
OLD | NEW |