| Index: chrome/browser/ui/webui/plugins_ui.cc
|
| diff --git a/chrome/browser/ui/webui/plugins_ui.cc b/chrome/browser/ui/webui/plugins_ui.cc
|
| index 1b9676f66e7579a50c5f86043bab5fce23968cf8..bdcdcad2c219ff77f8b2266581681c6c4ef7bf53 100644
|
| --- a/chrome/browser/ui/webui/plugins_ui.cc
|
| +++ b/chrome/browser/ui/webui/plugins_ui.cc
|
| @@ -66,6 +66,15 @@ using webkit::WebPluginInfo;
|
|
|
| namespace {
|
|
|
| +// Helper callback method to process result of CanEnablePlugin method.
|
| +void EnablePluginOrDieCallback(bool enable,
|
| + const FilePath& file_path,
|
| + scoped_refptr<PluginPrefs> plugin_prefs,
|
| + bool can_enable) {
|
| + DCHECK(can_enable);
|
| + plugin_prefs->EnablePlugin(enable, file_path, base::Bind(&base::DoNothing));
|
| +}
|
| +
|
| ChromeWebUIDataSource* CreatePluginsUIHTMLSource() {
|
| ChromeWebUIDataSource* source =
|
| new ChromeWebUIDataSource(chrome::kChromeUIPluginsHost);
|
| @@ -240,7 +249,7 @@ void PluginsDOMHandler::HandleEnablePluginMessage(const ListValue* args) {
|
| }
|
| bool enable = enable_str == "true";
|
|
|
| - PluginPrefs* plugin_prefs = PluginPrefs::GetForProfile(profile);
|
| + scoped_refptr<PluginPrefs> plugin_prefs(PluginPrefs::GetForProfile(profile));
|
| if (is_group_str == "true") {
|
| string16 group_name;
|
| if (!args->GetString(0, &group_name)) {
|
| @@ -266,9 +275,10 @@ void PluginsDOMHandler::HandleEnablePluginMessage(const ListValue* args) {
|
| NOTREACHED();
|
| return;
|
| }
|
| - DCHECK(plugin_prefs->CanEnablePlugin(enable, FilePath(file_path)));
|
| - plugin_prefs->EnablePlugin(enable, FilePath(file_path),
|
| - base::Bind(&base::DoNothing));
|
| +
|
| + plugin_prefs->CanEnablePlugin(enable, FilePath(file_path),
|
| + base::Bind(&EnablePluginOrDieCallback, enable, FilePath(file_path),
|
| + plugin_prefs));
|
| }
|
| }
|
|
|
|
|