| 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 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 // Check if the plug-in or its group is disabled by policy. | 243 // Check if the plug-in or its group is disabled by policy. |
| 244 if (plugin_status == POLICY_DISABLED || group_status == POLICY_DISABLED) | 244 if (plugin_status == POLICY_DISABLED || group_status == POLICY_DISABLED) |
| 245 return false; | 245 return false; |
| 246 | 246 |
| 247 #if !defined(DISABLE_NACL) | 247 #if !defined(DISABLE_NACL) |
| 248 // If enabling NaCl, make sure the plugin is also enabled. See bug | 248 // If enabling NaCl, make sure the plugin is also enabled. See bug |
| 249 // http://code.google.com/p/chromium/issues/detail?id=81010 for more | 249 // http://code.google.com/p/chromium/issues/detail?id=81010 for more |
| 250 // information. | 250 // information. |
| 251 // TODO(dspringer): When NaCl is on by default, remove this code. | 251 // TODO(dspringer): When NaCl is on by default, remove this code. |
| 252 if ((plugin.name == base::ASCIIToUTF16(nacl::kNaClPluginName)) && | 252 if ((plugin.name == base::ASCIIToUTF16(nacl::kNaClPluginName)) && |
| 253 CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableNaCl)) { | 253 base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 254 switches::kEnableNaCl)) { |
| 254 return true; | 255 return true; |
| 255 } | 256 } |
| 256 #endif | 257 #endif |
| 257 | 258 |
| 258 base::AutoLock auto_lock(lock_); | 259 base::AutoLock auto_lock(lock_); |
| 259 // Check user preferences for the plug-in. | 260 // Check user preferences for the plug-in. |
| 260 bool plugin_enabled = false; | 261 bool plugin_enabled = false; |
| 261 if (plugin_state_.Get(plugin.path, &plugin_enabled)) | 262 if (plugin_state_.Get(plugin.path, &plugin_enabled)) |
| 262 return plugin_enabled; | 263 return plugin_enabled; |
| 263 | 264 |
| (...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 577 } | 578 } |
| 578 } | 579 } |
| 579 | 580 |
| 580 void PluginPrefs::NotifyPluginStatusChanged() { | 581 void PluginPrefs::NotifyPluginStatusChanged() { |
| 581 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 582 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 582 content::NotificationService::current()->Notify( | 583 content::NotificationService::current()->Notify( |
| 583 chrome::NOTIFICATION_PLUGIN_ENABLE_STATUS_CHANGED, | 584 chrome::NOTIFICATION_PLUGIN_ENABLE_STATUS_CHANGED, |
| 584 content::Source<Profile>(profile_), | 585 content::Source<Profile>(profile_), |
| 585 content::NotificationService::NoDetails()); | 586 content::NotificationService::NoDetails()); |
| 586 } | 587 } |
| OLD | NEW |