OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/ui/webui/plugins/plugins_handler.h" | 5 #include "chrome/browser/ui/webui/plugins/plugins_handler.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 ->SetContentSettingCustomScope( | 164 ->SetContentSettingCustomScope( |
165 ContentSettingsPattern::Wildcard(), | 165 ContentSettingsPattern::Wildcard(), |
166 ContentSettingsPattern::Wildcard(), CONTENT_SETTINGS_TYPE_PLUGINS, | 166 ContentSettingsPattern::Wildcard(), CONTENT_SETTINGS_TYPE_PLUGINS, |
167 plugin.get(), | 167 plugin.get(), |
168 allowed ? CONTENT_SETTING_ALLOW : CONTENT_SETTING_DEFAULT); | 168 allowed ? CONTENT_SETTING_ALLOW : CONTENT_SETTING_DEFAULT); |
169 | 169 |
170 // Keep track of the whitelist separately, so that we can distinguish plugins | 170 // Keep track of the whitelist separately, so that we can distinguish plugins |
171 // whitelisted by the user from automatically whitelisted ones. | 171 // whitelisted by the user from automatically whitelisted ones. |
172 DictionaryPrefUpdate update(profile->GetPrefs(), | 172 DictionaryPrefUpdate update(profile->GetPrefs(), |
173 prefs::kContentSettingsPluginWhitelist); | 173 prefs::kContentSettingsPluginWhitelist); |
174 update->SetBoolean(plugin, allowed); | 174 update->SetBoolean(plugin.get(), allowed); |
175 } | 175 } |
176 | 176 |
177 void PluginsPageHandler::GetPluginsData( | 177 void PluginsPageHandler::GetPluginsData( |
178 const GetPluginsDataCallback& callback) { | 178 const GetPluginsDataCallback& callback) { |
179 if (weak_ptr_factory_.HasWeakPtrs()) | 179 if (weak_ptr_factory_.HasWeakPtrs()) |
180 return; | 180 return; |
181 | 181 |
182 content::PluginService::GetInstance()->GetPlugins( | 182 content::PluginService::GetInstance()->GetPlugins( |
183 base::Bind(&PluginsPageHandler::RespondWithPluginsData, | 183 base::Bind(&PluginsPageHandler::RespondWithPluginsData, |
184 weak_ptr_factory_.GetWeakPtr(), callback)); | 184 weak_ptr_factory_.GetWeakPtr(), callback)); |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
364 } | 364 } |
365 | 365 |
366 if (plugins_enabled_by_policy) | 366 if (plugins_enabled_by_policy) |
367 return "enabledByPolicy"; | 367 return "enabledByPolicy"; |
368 if (plugins_disabled_by_policy) | 368 if (plugins_disabled_by_policy) |
369 return "disabledByPolicy"; | 369 return "disabledByPolicy"; |
370 if (plugins_managed_by_policy) | 370 if (plugins_managed_by_policy) |
371 return "managedByPolicy"; | 371 return "managedByPolicy"; |
372 return group_enabled ? "enabledByUser" : "disabledByUser"; | 372 return group_enabled ? "enabledByUser" : "disabledByUser"; |
373 } | 373 } |
OLD | NEW |