summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions
diff options
context:
space:
mode:
authorrogerta@chromium.org <rogerta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-12 21:19:34 +0000
committerrogerta@chromium.org <rogerta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-12 21:19:34 +0000
commitcf25e4d9a950ed087bb580b5c07b5d175c17599e (patch)
treec06a8925f30720d9b50ec86b96b0e29f44222b95 /chrome/browser/extensions
parent27b09143a4ccf84b761689a0de4102d52e7086c4 (diff)
downloadchromium_src-cf25e4d9a950ed087bb580b5c07b5d175c17599e.zip
chromium_src-cf25e4d9a950ed087bb580b5c07b5d175c17599e.tar.gz
chromium_src-cf25e4d9a950ed087bb580b5c07b5d175c17599e.tar.bz2
Move metrics api to the experimental name space.
BUG=0 TEST=n/a Review URL: http://codereview.chromium.org/899003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41487 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions')
-rw-r--r--chrome/browser/extensions/extension_apitest.cc4
-rw-r--r--chrome/browser/extensions/extension_function_dispatcher.cc22
-rw-r--r--chrome/browser/extensions/extension_metrics_apitest.cc4
-rw-r--r--chrome/browser/extensions/extension_metrics_module.h18
4 files changed, 22 insertions, 26 deletions
diff --git a/chrome/browser/extensions/extension_apitest.cc b/chrome/browser/extensions/extension_apitest.cc
index a842c97..081a092 100644
--- a/chrome/browser/extensions/extension_apitest.cc
+++ b/chrome/browser/extensions/extension_apitest.cc
@@ -7,7 +7,6 @@
#include "chrome/browser/browser.h"
#include "chrome/browser/extensions/extensions_service.h"
#include "chrome/browser/profile.h"
-#include "chrome/common/chrome_switches.h"
#include "chrome/common/notification_registrar.h"
#include "chrome/test/ui_test_utils.h"
@@ -116,7 +115,4 @@ Extension* ExtensionApiTest::GetSingleLoadedExtension() {
void ExtensionApiTest::SetUpCommandLine(CommandLine* command_line) {
ExtensionBrowserTest::SetUpCommandLine(command_line);
test_data_dir_ = test_data_dir_.AppendASCII("api_test");
-
- // Needed for metrics extension API tests.
- command_line->AppendSwitch(switches::kEnableMetricsExtensionApi);
}
diff --git a/chrome/browser/extensions/extension_function_dispatcher.cc b/chrome/browser/extensions/extension_function_dispatcher.cc
index fb380a1..02facbd 100644
--- a/chrome/browser/extensions/extension_function_dispatcher.cc
+++ b/chrome/browser/extensions/extension_function_dispatcher.cc
@@ -35,7 +35,6 @@
#include "chrome/browser/profile.h"
#include "chrome/browser/renderer_host/render_process_host.h"
#include "chrome/browser/renderer_host/render_view_host.h"
-#include "chrome/common/chrome_switches.h"
#include "chrome/common/render_messages.h"
#include "chrome/common/result_codes.h"
#include "chrome/common/url_constants.h"
@@ -172,18 +171,15 @@ void FactoryRegistry::ResetFunctions() {
RegisterFunction<GetProcessForTabFunction>();
// Metrics.
- if (CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kEnableMetricsExtensionApi)) {
- RegisterFunction<MetricsRecordUserActionFunction>();
- RegisterFunction<MetricsRecordValueFunction>();
- RegisterFunction<MetricsRecordPercentageFunction>();
- RegisterFunction<MetricsRecordCountFunction>();
- RegisterFunction<MetricsRecordSmallCountFunction>();
- RegisterFunction<MetricsRecordMediumCountFunction>();
- RegisterFunction<MetricsRecordTimeFunction>();
- RegisterFunction<MetricsRecordMediumTimeFunction>();
- RegisterFunction<MetricsRecordLongTimeFunction>();
- }
+ RegisterFunction<MetricsRecordUserActionFunction>();
+ RegisterFunction<MetricsRecordValueFunction>();
+ RegisterFunction<MetricsRecordPercentageFunction>();
+ RegisterFunction<MetricsRecordCountFunction>();
+ RegisterFunction<MetricsRecordSmallCountFunction>();
+ RegisterFunction<MetricsRecordMediumCountFunction>();
+ RegisterFunction<MetricsRecordTimeFunction>();
+ RegisterFunction<MetricsRecordMediumTimeFunction>();
+ RegisterFunction<MetricsRecordLongTimeFunction>();
// Test.
RegisterFunction<ExtensionTestPassFunction>();
diff --git a/chrome/browser/extensions/extension_metrics_apitest.cc b/chrome/browser/extensions/extension_metrics_apitest.cc
index 39d342a..5a91e9f 100644
--- a/chrome/browser/extensions/extension_metrics_apitest.cc
+++ b/chrome/browser/extensions/extension_metrics_apitest.cc
@@ -7,6 +7,7 @@
#include "base/histogram.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/extensions/extension_apitest.h"
+#include "chrome/common/chrome_switches.h"
#include "chrome/common/extensions/extension.h"
#include "chrome/common/notification_registrar.h"
@@ -139,6 +140,9 @@ void ValidateHistograms(const Extension* extension,
} // anonymous namespace
IN_PROC_BROWSER_TEST_F(ExtensionApiTest, Metrics) {
+ CommandLine::ForCurrentProcess()->AppendSwitch(
+ switches::kEnableExperimentalExtensionApis);
+
UserActionObserver observer;
ASSERT_TRUE(RunExtensionTest("metrics")) << message_;
diff --git a/chrome/browser/extensions/extension_metrics_module.h b/chrome/browser/extensions/extension_metrics_module.h
index c2ffdd2..81e12be 100644
--- a/chrome/browser/extensions/extension_metrics_module.h
+++ b/chrome/browser/extensions/extension_metrics_module.h
@@ -12,7 +12,7 @@
class MetricsRecordUserActionFunction : public SyncExtensionFunction {
virtual bool RunImpl();
- DECLARE_EXTENSION_FUNCTION_NAME("metrics.recordUserAction")
+ DECLARE_EXTENSION_FUNCTION_NAME("experimental.metrics.recordUserAction")
};
class MetricsHistogramHelperFunction : public SyncExtensionFunction {
@@ -24,42 +24,42 @@ class MetricsHistogramHelperFunction : public SyncExtensionFunction {
class MetricsRecordValueFunction : public MetricsHistogramHelperFunction {
virtual bool RunImpl();
- DECLARE_EXTENSION_FUNCTION_NAME("metrics.recordValue")
+ DECLARE_EXTENSION_FUNCTION_NAME("experimental.metrics.recordValue")
};
class MetricsRecordPercentageFunction : public MetricsHistogramHelperFunction {
virtual bool RunImpl();
- DECLARE_EXTENSION_FUNCTION_NAME("metrics.recordPercentage")
+ DECLARE_EXTENSION_FUNCTION_NAME("experimental.metrics.recordPercentage")
};
class MetricsRecordCountFunction : public MetricsHistogramHelperFunction {
virtual bool RunImpl();
- DECLARE_EXTENSION_FUNCTION_NAME("metrics.recordCount")
+ DECLARE_EXTENSION_FUNCTION_NAME("experimental.metrics.recordCount")
};
class MetricsRecordSmallCountFunction : public MetricsHistogramHelperFunction {
virtual bool RunImpl();
- DECLARE_EXTENSION_FUNCTION_NAME("metrics.recordSmallCount")
+ DECLARE_EXTENSION_FUNCTION_NAME("experimental.metrics.recordSmallCount")
};
class MetricsRecordMediumCountFunction : public MetricsHistogramHelperFunction {
virtual bool RunImpl();
- DECLARE_EXTENSION_FUNCTION_NAME("metrics.recordMediumCount")
+ DECLARE_EXTENSION_FUNCTION_NAME("experimental.metrics.recordMediumCount")
};
class MetricsRecordTimeFunction : public MetricsHistogramHelperFunction {
virtual bool RunImpl();
- DECLARE_EXTENSION_FUNCTION_NAME("metrics.recordTime")
+ DECLARE_EXTENSION_FUNCTION_NAME("experimental.metrics.recordTime")
};
class MetricsRecordMediumTimeFunction : public MetricsHistogramHelperFunction {
virtual bool RunImpl();
- DECLARE_EXTENSION_FUNCTION_NAME("metrics.recordMediumTime")
+ DECLARE_EXTENSION_FUNCTION_NAME("experimental.metrics.recordMediumTime")
};
class MetricsRecordLongTimeFunction : public MetricsHistogramHelperFunction {
virtual bool RunImpl();
- DECLARE_EXTENSION_FUNCTION_NAME("metrics.recordLongTime")
+ DECLARE_EXTENSION_FUNCTION_NAME("experimental.metrics.recordLongTime")
};
#endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_METRICS_MODULE_H__