OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <algorithm> | 5 #include <algorithm> |
6 | 6 |
7 #include "webkit/plugins/npapi/plugin_group.h" | 7 #include "webkit/plugins/npapi/plugin_group.h" |
8 | 8 |
9 #include "base/linked_ptr.h" | 9 #include "base/linked_ptr.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
481 bool PluginGroup::RequiresAuthorization() const { | 481 bool PluginGroup::RequiresAuthorization() const { |
482 for (size_t i = 0; i < version_ranges_.size(); ++i) { | 482 for (size_t i = 0; i < version_ranges_.size(); ++i) { |
483 if (IsVersionInRange(*version_, version_ranges_[i]) && | 483 if (IsVersionInRange(*version_, version_ranges_[i]) && |
484 version_ranges_[i].requires_authorization) | 484 version_ranges_[i].requires_authorization) |
485 return true; | 485 return true; |
486 } | 486 } |
487 return false; | 487 return false; |
488 } | 488 } |
489 | 489 |
490 bool PluginGroup::IsEmpty() const { | 490 bool PluginGroup::IsEmpty() const { |
491 return web_plugin_infos_.size() == 0; | 491 return web_plugin_infos_.empty(); |
492 } | 492 } |
493 | 493 |
494 void PluginGroup::DisableOutdatedPlugins() { | 494 void PluginGroup::DisableOutdatedPlugins() { |
495 ResetGroupState(); | 495 ResetGroupState(); |
496 for (size_t i = 0; i < web_plugin_infos_.size(); ++i) { | 496 for (size_t i = 0; i < web_plugin_infos_.size(); ++i) { |
497 scoped_ptr<Version> version( | 497 scoped_ptr<Version> version( |
498 CreateVersionFromString(web_plugin_infos_[i].version)); | 498 CreateVersionFromString(web_plugin_infos_[i].version)); |
499 if (version.get()) { | 499 if (version.get()) { |
500 for (size_t j = 0; j < version_ranges_.size(); ++j) { | 500 for (size_t j = 0; j < version_ranges_.size(); ++j) { |
501 if (IsPluginOutdated(*version, version_ranges_[j])) { | 501 if (IsPluginOutdated(*version, version_ranges_[j])) { |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
612 bool PluginGroup::Disable(WebPluginInfo* plugin, int new_reason) { | 612 bool PluginGroup::Disable(WebPluginInfo* plugin, int new_reason) { |
613 DCHECK(new_reason == WebPluginInfo::USER_DISABLED || | 613 DCHECK(new_reason == WebPluginInfo::USER_DISABLED || |
614 new_reason == WebPluginInfo::POLICY_DISABLED || | 614 new_reason == WebPluginInfo::POLICY_DISABLED || |
615 new_reason == WebPluginInfo::USER_DISABLED_POLICY_DISABLED || | 615 new_reason == WebPluginInfo::USER_DISABLED_POLICY_DISABLED || |
616 new_reason == WebPluginInfo::POLICY_UNMANAGED); | 616 new_reason == WebPluginInfo::POLICY_UNMANAGED); |
617 return SetPluginState(plugin, new_reason, IsPluginEnabled(*plugin)); | 617 return SetPluginState(plugin, new_reason, IsPluginEnabled(*plugin)); |
618 } | 618 } |
619 | 619 |
620 } // namespace npapi | 620 } // namespace npapi |
621 } // namespace webkit | 621 } // namespace webkit |
OLD | NEW |