OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/options_page_base.h" |
| 6 |
| 7 #include "chrome/browser/metrics/user_metrics.h" |
| 8 #include "chrome/common/notification_service.h" |
| 9 #include "chrome/common/pref_service.h" |
| 10 |
| 11 /////////////////////////////////////////////////////////////////////////////// |
| 12 // OptionsPageBase |
| 13 |
| 14 OptionsPageBase::OptionsPageBase(Profile* profile) |
| 15 : profile_(profile) { |
| 16 } |
| 17 |
| 18 OptionsPageBase::~OptionsPageBase() { |
| 19 } |
| 20 |
| 21 void OptionsPageBase::UserMetricsRecordAction(const wchar_t* action, |
| 22 PrefService* prefs) { |
| 23 UserMetrics::RecordComputedAction(action, profile()); |
| 24 if (prefs) |
| 25 prefs->ScheduleSavePersistentPrefs(); |
| 26 } |
| 27 |
| 28 /////////////////////////////////////////////////////////////////////////////// |
| 29 // OptionsPageBase, NotificationObserver implementation: |
| 30 |
| 31 void OptionsPageBase::Observe(NotificationType type, |
| 32 const NotificationSource& source, |
| 33 const NotificationDetails& details) { |
| 34 if (type == NotificationType::PREF_CHANGED) |
| 35 NotifyPrefChanged(Details<std::wstring>(details).ptr()); |
| 36 } |
OLD | NEW |