Index: chrome/browser/extensions/extension_metrics_module.cc |
diff --git a/chrome/browser/extensions/extension_metrics_module.cc b/chrome/browser/extensions/extension_metrics_module.cc |
index 8e3428d1e146b8ba8f8d688a4ca313fff45fad49..4bba31beeea8d67ae24eba44d5668f6a9d5e081b 100644 |
--- a/chrome/browser/extensions/extension_metrics_module.cc |
+++ b/chrome/browser/extensions/extension_metrics_module.cc |
@@ -16,23 +16,23 @@ using base::LinearHistogram; |
namespace { |
-// Build the full name of a metrics for the given extension. Each metric |
-// is made up of the unique name within the extension followed by the |
-// extension's id. This keeps the metrics from one extension unique from |
-// other extensions, as well as those metrics from chrome itself. |
+// Build the full name of a metrics for the given extension. |
+// For a non-component extension the metric name is made up of the unique name |
+// within the extension followed by the extension's id. This keeps the metrics |
+// from one extension unique from other extensions, as well as those metrics |
+// from chrome itself. |
+// For a component extension the metric name is used as is. There are not so |
+// many of them and it is easy enough to prevent name clashes. |
std::string BuildMetricName(const std::string& name, |
const Extension* extension) { |
std::string full_name(name); |
- full_name += extension->id(); |
+ if (extension->location() != Extension::COMPONENT) |
+ full_name += extension->id(); |
return full_name; |
} |
} // anonymous namespace |
-// These extension function classes are enabled only if the |
-// enable-metrics-extension-api command line switch is used. Refer to |
-// extension_function_dispatcher.cc to see how they are enabled. |
- |
bool MetricsSetEnabledFunction::RunImpl() { |
bool enabled = false; |
EXTENSION_FUNCTION_VALIDATE(args_->GetBoolean(0, &enabled)); |