Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(146)

Side by Side Diff: chrome/browser/plugin_exceptions_table_model.cc

Issue 7980011: Convert the PluginService interface to be an async wrapper around PluginList. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Ready for review Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698