| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/plugins/plugin_prefs.h" | 5 #include "chrome/browser/plugins/plugin_prefs.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 | 238 |
| 239 // Check if the plug-in or its group is disabled by policy. | 239 // Check if the plug-in or its group is disabled by policy. |
| 240 if (plugin_status == POLICY_DISABLED || group_status == POLICY_DISABLED) | 240 if (plugin_status == POLICY_DISABLED || group_status == POLICY_DISABLED) |
| 241 return false; | 241 return false; |
| 242 | 242 |
| 243 // If enabling NaCl, make sure the plugin is also enabled. See bug | 243 // If enabling NaCl, make sure the plugin is also enabled. See bug |
| 244 // http://code.google.com/p/chromium/issues/detail?id=81010 for more | 244 // http://code.google.com/p/chromium/issues/detail?id=81010 for more |
| 245 // information. | 245 // information. |
| 246 // TODO(dspringer): When NaCl is on by default, remove this code. | 246 // TODO(dspringer): When NaCl is on by default, remove this code. |
| 247 if ((plugin.name == | 247 if ((plugin.name == |
| 248 ASCIIToUTF16(chrome::ChromeContentClient::kNaClPluginName)) && | 248 ASCIIToUTF16(ChromeContentClient::kNaClPluginName)) && |
| 249 CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableNaCl)) { | 249 CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableNaCl)) { |
| 250 return true; | 250 return true; |
| 251 } | 251 } |
| 252 | 252 |
| 253 base::AutoLock auto_lock(lock_); | 253 base::AutoLock auto_lock(lock_); |
| 254 // Check user preferences for the plug-in. | 254 // Check user preferences for the plug-in. |
| 255 bool plugin_enabled = false; | 255 bool plugin_enabled = false; |
| 256 if (plugin_state_.Get(plugin.path, &plugin_enabled)) | 256 if (plugin_state_.Get(plugin.path, &plugin_enabled)) |
| 257 return plugin_enabled; | 257 return plugin_enabled; |
| 258 | 258 |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 570 } | 570 } |
| 571 } | 571 } |
| 572 | 572 |
| 573 void PluginPrefs::NotifyPluginStatusChanged() { | 573 void PluginPrefs::NotifyPluginStatusChanged() { |
| 574 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 574 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 575 content::NotificationService::current()->Notify( | 575 content::NotificationService::current()->Notify( |
| 576 chrome::NOTIFICATION_PLUGIN_ENABLE_STATUS_CHANGED, | 576 chrome::NOTIFICATION_PLUGIN_ENABLE_STATUS_CHANGED, |
| 577 content::Source<Profile>(profile_), | 577 content::Source<Profile>(profile_), |
| 578 content::NotificationService::NoDetails()); | 578 content::NotificationService::NoDetails()); |
| 579 } | 579 } |
| OLD | NEW |