Use plugin state from default profile in metrics log.
BUG=80794
TEST=none
Review URL: http://codereview.chromium.org/7497062
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@97479 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/browser/metrics/metrics_log.cc b/chrome/browser/metrics/metrics_log.cc
index 8200f44..fc5fc76 100644
--- a/chrome/browser/metrics/metrics_log.cc
+++ b/chrome/browser/metrics/metrics_log.cc
@@ -20,7 +20,9 @@
#include "chrome/browser/autocomplete/autocomplete_match.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/metrics/display_utils.h"
+#include "chrome/browser/plugin_prefs.h"
#include "chrome/browser/prefs/pref_service.h"
+#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/common/chrome_version_info.h"
#include "chrome/common/logging_chrome.h"
#include "chrome/common/pref_names.h"
@@ -273,6 +275,10 @@
const std::vector<webkit::WebPluginInfo>& plugin_list) {
DCHECK(!locked_);
+ ProfileManager* profile_manager = g_browser_process->profile_manager();
+ PluginPrefs* plugin_prefs =
+ PluginPrefs::GetForProfile(profile_manager->GetLoadedProfiles().front());
+
OPEN_ELEMENT_FOR_SCOPE("plugins");
for (std::vector<webkit::WebPluginInfo>::const_iterator iter =
@@ -291,8 +297,7 @@
#endif
WriteAttribute("filename", CreateBase64Hash(filename_bytes));
WriteAttribute("version", UTF16ToUTF8(iter->version));
- // TODO(bauerb): Plug-in state is per-profile.
- WriteIntAttribute("disabled", !webkit::IsPluginEnabled(*iter));
+ WriteIntAttribute("disabled", !plugin_prefs->IsPluginEnabled(*iter));
}
}