| 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 <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 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 415 const std::vector<PluginGroup*>& PluginList::GetHardcodedPluginGroups() const { | 415 const std::vector<PluginGroup*>& PluginList::GetHardcodedPluginGroups() const { |
| 416 return hardcoded_plugin_groups_.get(); | 416 return hardcoded_plugin_groups_.get(); |
| 417 } | 417 } |
| 418 | 418 |
| 419 void PluginList::SetPlugins(const std::vector<webkit::WebPluginInfo>& plugins) { | 419 void PluginList::SetPlugins(const std::vector<webkit::WebPluginInfo>& plugins) { |
| 420 base::AutoLock lock(lock_); | 420 base::AutoLock lock(lock_); |
| 421 | 421 |
| 422 DCHECK_NE(LOADING_STATE_REFRESHING, loading_state_); | 422 DCHECK_NE(LOADING_STATE_REFRESHING, loading_state_); |
| 423 loading_state_ = LOADING_STATE_UP_TO_DATE; | 423 loading_state_ = LOADING_STATE_UP_TO_DATE; |
| 424 | 424 |
| 425 plugin_groups_.reset(); | 425 plugin_groups_.clear(); |
| 426 for (std::vector<webkit::WebPluginInfo>::const_iterator it = plugins.begin(); | 426 for (std::vector<webkit::WebPluginInfo>::const_iterator it = plugins.begin(); |
| 427 it != plugins.end(); | 427 it != plugins.end(); |
| 428 ++it) { | 428 ++it) { |
| 429 AddToPluginGroups(*it, &plugin_groups_); | 429 AddToPluginGroups(*it, &plugin_groups_); |
| 430 } | 430 } |
| 431 } | 431 } |
| 432 | 432 |
| 433 void PluginList::set_will_load_plugins_callback(const base::Closure& callback) { | 433 void PluginList::set_will_load_plugins_callback(const base::Closure& callback) { |
| 434 base::AutoLock lock(lock_); | 434 base::AutoLock lock(lock_); |
| 435 will_load_plugins_callback_ = callback; | 435 will_load_plugins_callback_ = callback; |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 630 } | 630 } |
| 631 return false; | 631 return false; |
| 632 } | 632 } |
| 633 | 633 |
| 634 PluginList::~PluginList() { | 634 PluginList::~PluginList() { |
| 635 } | 635 } |
| 636 | 636 |
| 637 | 637 |
| 638 } // namespace npapi | 638 } // namespace npapi |
| 639 } // namespace webkit | 639 } // namespace webkit |
| OLD | NEW |