| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/glue/plugins/plugin_list.h" | 5 #include "webkit/glue/plugins/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 27 matching lines...) Expand all Loading... |
| 38 AutoLock lock(lock_); | 38 AutoLock lock(lock_); |
| 39 return plugins_loaded_; | 39 return plugins_loaded_; |
| 40 } | 40 } |
| 41 | 41 |
| 42 void PluginList::RefreshPlugins() { | 42 void PluginList::RefreshPlugins() { |
| 43 AutoLock lock(lock_); | 43 AutoLock lock(lock_); |
| 44 plugins_need_refresh_ = true; | 44 plugins_need_refresh_ = true; |
| 45 } | 45 } |
| 46 | 46 |
| 47 void PluginList::AddExtraPluginPath(const FilePath& plugin_path) { | 47 void PluginList::AddExtraPluginPath(const FilePath& plugin_path) { |
| 48 // Chrome OS only loads plugins from /opt/google/chrome/plugins. |
| 49 #if !defined(OS_CHROMEOS) |
| 48 AutoLock lock(lock_); | 50 AutoLock lock(lock_); |
| 49 extra_plugin_paths_.push_back(plugin_path); | 51 extra_plugin_paths_.push_back(plugin_path); |
| 52 #endif |
| 50 } | 53 } |
| 51 | 54 |
| 52 void PluginList::RemoveExtraPluginPath(const FilePath& plugin_path) { | 55 void PluginList::RemoveExtraPluginPath(const FilePath& plugin_path) { |
| 53 AutoLock lock(lock_); | 56 AutoLock lock(lock_); |
| 54 std::vector<FilePath>::iterator it = | 57 std::vector<FilePath>::iterator it = |
| 55 std::find(extra_plugin_paths_.begin(), extra_plugin_paths_.end(), | 58 std::find(extra_plugin_paths_.begin(), extra_plugin_paths_.end(), |
| 56 plugin_path); | 59 plugin_path); |
| 57 if (it != extra_plugin_paths_.end()) | 60 if (it != extra_plugin_paths_.end()) |
| 58 extra_plugin_paths_.erase(it); | 61 extra_plugin_paths_.erase(it); |
| 59 } | 62 } |
| 60 | 63 |
| 61 void PluginList::AddExtraPluginDir(const FilePath& plugin_dir) { | 64 void PluginList::AddExtraPluginDir(const FilePath& plugin_dir) { |
| 65 // Chrome OS only loads plugins from /opt/google/chrome/plugins. |
| 66 #if !defined(OS_CHROMEOS) |
| 62 AutoLock lock(lock_); | 67 AutoLock lock(lock_); |
| 63 extra_plugin_dirs_.push_back(plugin_dir); | 68 extra_plugin_dirs_.push_back(plugin_dir); |
| 69 #endif |
| 64 } | 70 } |
| 65 | 71 |
| 66 void PluginList::RegisterInternalPlugin(const PluginVersionInfo& info) { | 72 void PluginList::RegisterInternalPlugin(const PluginVersionInfo& info) { |
| 67 AutoLock lock(lock_); | 73 AutoLock lock(lock_); |
| 68 internal_plugins_.push_back(info); | 74 internal_plugins_.push_back(info); |
| 69 } | 75 } |
| 70 | 76 |
| 71 void PluginList::UnregisterInternalPlugin(const FilePath& path) { | 77 void PluginList::UnregisterInternalPlugin(const FilePath& path) { |
| 72 AutoLock lock(lock_); | 78 AutoLock lock(lock_); |
| 73 for (size_t i = 0; i < internal_plugins_.size(); i++) { | 79 for (size_t i = 0; i < internal_plugins_.size(); i++) { |
| (...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 457 } | 463 } |
| 458 | 464 |
| 459 return did_disable; | 465 return did_disable; |
| 460 } | 466 } |
| 461 | 467 |
| 462 void PluginList::Shutdown() { | 468 void PluginList::Shutdown() { |
| 463 // TODO | 469 // TODO |
| 464 } | 470 } |
| 465 | 471 |
| 466 } // namespace NPAPI | 472 } // namespace NPAPI |
| OLD | NEW |