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 "chrome/browser/plugin_exceptions_table_model.h" | 5 #include "chrome/browser/plugin_exceptions_table_model.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/sys_string_conversions.h" | 8 #include "base/sys_string_conversions.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "chrome/common/chrome_notification_types.h" | 10 #include "chrome/common/chrome_notification_types.h" |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 | 132 |
133 void PluginExceptionsTableModel::ClearSettings() { | 133 void PluginExceptionsTableModel::ClearSettings() { |
134 settings_.clear(); | 134 settings_.clear(); |
135 groups_.clear(); | 135 groups_.clear(); |
136 row_counts_.clear(); | 136 row_counts_.clear(); |
137 resources_.clear(); | 137 resources_.clear(); |
138 } | 138 } |
139 | 139 |
140 void PluginExceptionsTableModel::GetPlugins( | 140 void PluginExceptionsTableModel::GetPlugins( |
141 std::vector<webkit::npapi::PluginGroup>* plugin_groups) { | 141 std::vector<webkit::npapi::PluginGroup>* plugin_groups) { |
142 webkit::npapi::PluginList::Singleton()->GetPluginGroups(false, plugin_groups); | 142 PluginService::GetInstance()->GetCachedPluginGroups(plugin_groups); |
143 } | 143 } |
144 | 144 |
145 void PluginExceptionsTableModel::LoadSettings() { | 145 void PluginExceptionsTableModel::LoadSettings() { |
146 int group_id = 0; | 146 int group_id = 0; |
147 std::vector<webkit::npapi::PluginGroup> plugins; | 147 std::vector<webkit::npapi::PluginGroup> plugins; |
148 GetPlugins(&plugins); | 148 GetPlugins(&plugins); |
149 for (size_t i = 0; i < plugins.size(); ++i) { | 149 for (size_t i = 0; i < plugins.size(); ++i) { |
150 std::string plugin = plugins[i].identifier(); | 150 std::string plugin = plugins[i].identifier(); |
151 HostContentSettingsMap::SettingsForOneType settings; | 151 HostContentSettingsMap::SettingsForOneType settings; |
152 map_->GetSettingsForOneType(CONTENT_SETTINGS_TYPE_PLUGINS, | 152 map_->GetSettingsForOneType(CONTENT_SETTINGS_TYPE_PLUGINS, |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 } | 191 } |
192 } | 192 } |
193 | 193 |
194 void PluginExceptionsTableModel::ReloadSettings() { | 194 void PluginExceptionsTableModel::ReloadSettings() { |
195 ClearSettings(); | 195 ClearSettings(); |
196 LoadSettings(); | 196 LoadSettings(); |
197 | 197 |
198 if (observer_) | 198 if (observer_) |
199 observer_->OnModelChanged(); | 199 observer_->OnModelChanged(); |
200 } | 200 } |
OLD | NEW |