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 "webkit/plugins/npapi/plugin_list.h" | 5 #include "webkit/plugins/npapi/plugin_list.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
298 version_info_win->GetStringValue(L"FileOpenName"), | 298 version_info_win->GetStringValue(L"FileOpenName"), |
299 &info->mime_types)) { | 299 &info->mime_types)) { |
300 LOG_IF(ERROR, PluginList::DebugPluginLoading()) | 300 LOG_IF(ERROR, PluginList::DebugPluginLoading()) |
301 << "Plugin " << info->name << " has bad MIME types, skipping"; | 301 << "Plugin " << info->name << " has bad MIME types, skipping"; |
302 return false; | 302 return false; |
303 } | 303 } |
304 | 304 |
305 return true; | 305 return true; |
306 } | 306 } |
307 | 307 |
308 void PluginList::GetPluginDirectories(std::vector<base::FilePath>* plugin_dirs) { | 308 void PluginList::GetPluginDirectories( |
309 std::vector<base::FilePath>* plugin_dirs) { | |
310 if (PluginList::plugins_discovery_disabled_) | |
311 return; | |
312 | |
309 // We use a set for uniqueness, which we require, over order, which we do not. | 313 // We use a set for uniqueness, which we require, over order, which we do not. |
310 std::set<base::FilePath> dirs; | 314 std::set<base::FilePath> dirs; |
311 | 315 |
312 // Load from the application-specific area | 316 // Load from the application-specific area |
313 GetAppDirectory(&dirs); | 317 GetAppDirectory(&dirs); |
314 | 318 |
315 // Load from the executable area | 319 // Load from the executable area |
316 GetExeDirectory(&dirs); | 320 GetExeDirectory(&dirs); |
317 | 321 |
318 // Load Java | 322 // Load Java |
(...skipping 30 matching lines...) Expand all Loading... | |
349 if (!(find_file_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) { | 353 if (!(find_file_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) { |
350 base::FilePath filename = path.Append(find_file_data.cFileName); | 354 base::FilePath filename = path.Append(find_file_data.cFileName); |
351 plugins->push_back(filename); | 355 plugins->push_back(filename); |
352 } | 356 } |
353 } while (FindNextFile(find_handle, &find_file_data) != 0); | 357 } while (FindNextFile(find_handle, &find_file_data) != 0); |
354 | 358 |
355 DCHECK(GetLastError() == ERROR_NO_MORE_FILES); | 359 DCHECK(GetLastError() == ERROR_NO_MORE_FILES); |
356 FindClose(find_handle); | 360 FindClose(find_handle); |
357 } | 361 } |
358 | 362 |
359 void PluginList::GetPluginPathsFromRegistry(std::vector<base::FilePath>* plugins ) { | 363 void PluginList::GetPluginPathsFromRegistry(std::vector<base::FilePath>* plugins ) { |
Bernhard Bauer
2013/06/07 10:33:43
Can you make this fit into 80 columns please?
(I
seva
2013/06/07 19:02:36
Done.
| |
364 if (PluginList::plugins_discovery_disabled_) | |
365 return; | |
366 | |
360 std::set<base::FilePath> plugin_dirs; | 367 std::set<base::FilePath> plugin_dirs; |
361 | 368 |
362 GetPluginsInRegistryDirectory( | 369 GetPluginsInRegistryDirectory( |
363 HKEY_CURRENT_USER, kRegistryMozillaPlugins, &plugin_dirs); | 370 HKEY_CURRENT_USER, kRegistryMozillaPlugins, &plugin_dirs); |
364 GetPluginsInRegistryDirectory( | 371 GetPluginsInRegistryDirectory( |
365 HKEY_LOCAL_MACHINE, kRegistryMozillaPlugins, &plugin_dirs); | 372 HKEY_LOCAL_MACHINE, kRegistryMozillaPlugins, &plugin_dirs); |
366 | 373 |
367 for (std::set<base::FilePath>::iterator i = plugin_dirs.begin(); | 374 for (std::set<base::FilePath>::iterator i = plugin_dirs.begin(); |
368 i != plugin_dirs.end(); ++i) { | 375 i != plugin_dirs.end(); ++i) { |
369 plugins->push_back(*i); | 376 plugins->push_back(*i); |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
458 // The plugin in question could be a 64 bit plugin which we cannot load. | 465 // The plugin in question could be a 64 bit plugin which we cannot load. |
459 base::FilePath plugin_path(info.path); | 466 base::FilePath plugin_path(info.path); |
460 if (!IsValid32BitImage(base::MakeAbsoluteFilePath(plugin_path))) | 467 if (!IsValid32BitImage(base::MakeAbsoluteFilePath(plugin_path))) |
461 return false; | 468 return false; |
462 #endif | 469 #endif |
463 return true; | 470 return true; |
464 } | 471 } |
465 | 472 |
466 } // namespace npapi | 473 } // namespace npapi |
467 } // namespace webkit | 474 } // namespace webkit |
OLD | NEW |