summaryrefslogtreecommitdiffstats
path: root/chrome/browser/options_page_base.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/options_page_base.cc')
-rw-r--r--chrome/browser/options_page_base.cc36
1 files changed, 36 insertions, 0 deletions
diff --git a/chrome/browser/options_page_base.cc b/chrome/browser/options_page_base.cc
new file mode 100644
index 0000000..d875f33
--- /dev/null
+++ b/chrome/browser/options_page_base.cc
@@ -0,0 +1,36 @@
+// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/options_page_base.h"
+
+#include "chrome/browser/metrics/user_metrics.h"
+#include "chrome/common/notification_service.h"
+#include "chrome/common/pref_service.h"
+
+///////////////////////////////////////////////////////////////////////////////
+// OptionsPageBase
+
+OptionsPageBase::OptionsPageBase(Profile* profile)
+ : profile_(profile) {
+}
+
+OptionsPageBase::~OptionsPageBase() {
+}
+
+void OptionsPageBase::UserMetricsRecordAction(const wchar_t* action,
+ PrefService* prefs) {
+ UserMetrics::RecordComputedAction(action, profile());
+ if (prefs)
+ prefs->ScheduleSavePersistentPrefs();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// OptionsPageBase, NotificationObserver implementation:
+
+void OptionsPageBase::Observe(NotificationType type,
+ const NotificationSource& source,
+ const NotificationDetails& details) {
+ if (type == NotificationType::PREF_CHANGED)
+ NotifyPrefChanged(Details<std::wstring>(details).ptr());
+}