diff options
Diffstat (limited to 'chrome/browser/prefs')
-rw-r--r-- | chrome/browser/prefs/pref_change_registrar_unittest.cc | 2 | ||||
-rw-r--r-- | chrome/browser/prefs/pref_member.cc | 6 | ||||
-rw-r--r-- | chrome/browser/prefs/pref_member.h | 2 | ||||
-rw-r--r-- | chrome/browser/prefs/pref_member_unittest.cc | 7 | ||||
-rw-r--r-- | chrome/browser/prefs/pref_model_associator.cc | 3 | ||||
-rw-r--r-- | chrome/browser/prefs/pref_notifier_impl.cc | 5 | ||||
-rw-r--r-- | chrome/browser/prefs/pref_notifier_impl_unittest.cc | 6 | ||||
-rw-r--r-- | chrome/browser/prefs/pref_observer_mock.cc | 3 | ||||
-rw-r--r-- | chrome/browser/prefs/pref_observer_mock.h | 4 | ||||
-rw-r--r-- | chrome/browser/prefs/pref_set_observer.cc | 4 | ||||
-rw-r--r-- | chrome/browser/prefs/pref_set_observer.h | 2 | ||||
-rw-r--r-- | chrome/browser/prefs/pref_set_observer_unittest.cc | 5 |
12 files changed, 26 insertions, 23 deletions
diff --git a/chrome/browser/prefs/pref_change_registrar_unittest.cc b/chrome/browser/prefs/pref_change_registrar_unittest.cc index 55ccb11..d0044dd 100644 --- a/chrome/browser/prefs/pref_change_registrar_unittest.cc +++ b/chrome/browser/prefs/pref_change_registrar_unittest.cc @@ -4,10 +4,10 @@ #include "chrome/browser/prefs/pref_change_registrar.h" #include "chrome/test/testing_pref_service.h" +#include "content/common/content_notification_types.h" #include "content/common/notification_details.h" #include "content/common/notification_observer_mock.h" #include "content/common/notification_source.h" -#include "content/common/notification_type.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" diff --git a/chrome/browser/prefs/pref_member.cc b/chrome/browser/prefs/pref_member.cc index 78a485d..43fee58 100644 --- a/chrome/browser/prefs/pref_member.cc +++ b/chrome/browser/prefs/pref_member.cc @@ -7,7 +7,7 @@ #include "base/logging.h" #include "base/value_conversions.h" #include "chrome/browser/prefs/pref_service.h" -#include "content/common/notification_type.h" +#include "chrome/common/chrome_notification_types.h" namespace subtle { @@ -51,11 +51,11 @@ void PrefMemberBase::MoveToThread(BrowserThread::ID thread_id) { internal()->MoveToThread(thread_id); } -void PrefMemberBase::Observe(NotificationType type, +void PrefMemberBase::Observe(int type, const NotificationSource& source, const NotificationDetails& details) { VerifyValuePrefName(); - DCHECK(NotificationType::PREF_CHANGED == type); + DCHECK(chrome::NOTIFICATION_PREF_CHANGED == type); UpdateValueFromPref(); if (!setting_value_ && observer_) observer_->Observe(type, source, details); diff --git a/chrome/browser/prefs/pref_member.h b/chrome/browser/prefs/pref_member.h index 5e58a39..b5d9618 100644 --- a/chrome/browser/prefs/pref_member.h +++ b/chrome/browser/prefs/pref_member.h @@ -92,7 +92,7 @@ class PrefMemberBase : public NotificationObserver { void MoveToThread(BrowserThread::ID thread_id); // NotificationObserver - virtual void Observe(NotificationType type, + virtual void Observe(int type, const NotificationSource& source, const NotificationDetails& details); diff --git a/chrome/browser/prefs/pref_member_unittest.cc b/chrome/browser/prefs/pref_member_unittest.cc index 3cc4cb6..fdbfbb3 100644 --- a/chrome/browser/prefs/pref_member_unittest.cc +++ b/chrome/browser/prefs/pref_member_unittest.cc @@ -6,13 +6,12 @@ #include "base/message_loop.h" #include "chrome/browser/prefs/pref_value_store.h" +#include "chrome/common/chrome_notification_types.h" #include "chrome/test/testing_pref_service.h" #include "content/browser/browser_thread.h" #include "content/common/notification_details.h" #include "content/common/notification_source.h" -#include "content/common/notification_type.h" #include "testing/gtest/include/gtest/gtest.h" - namespace { const char kBoolPref[] = "bool"; @@ -73,10 +72,10 @@ class PrefMemberTestClass : public NotificationObserver { str_.Init(kStringPref, prefs, this); } - virtual void Observe(NotificationType type, + virtual void Observe(int type, const NotificationSource& source, const NotificationDetails& details) { - DCHECK(NotificationType::PREF_CHANGED == type); + DCHECK(chrome::NOTIFICATION_PREF_CHANGED == type); PrefService* prefs_in = Source<PrefService>(source).ptr(); EXPECT_EQ(prefs_in, prefs_); std::string* pref_name_in = Details<std::string>(details).ptr(); diff --git a/chrome/browser/prefs/pref_model_associator.cc b/chrome/browser/prefs/pref_model_associator.cc index e05134b..5c004a7b 100644 --- a/chrome/browser/prefs/pref_model_associator.cc +++ b/chrome/browser/prefs/pref_model_associator.cc @@ -12,6 +12,7 @@ #include "base/values.h" #include "chrome/browser/sync/api/sync_change.h" #include "chrome/browser/sync/protocol/preference_specifics.pb.h" +#include "chrome/common/chrome_notification_types.h" #include "chrome/common/pref_names.h" #include "content/common/json_value_serializer.h" #include "content/common/notification_service.h" @@ -273,7 +274,7 @@ void PrefModelAssociator::SendUpdateNotificationsIfNecessary( // notification to update the UI. if (0 == pref_name.compare(prefs::kShowBookmarkBar)) { NotificationService::current()->Notify( - NotificationType::BOOKMARK_BAR_VISIBILITY_PREF_CHANGED, + chrome::NOTIFICATION_BOOKMARK_BAR_VISIBILITY_PREF_CHANGED, Source<PrefModelAssociator>(this), NotificationService::NoDetails()); } diff --git a/chrome/browser/prefs/pref_notifier_impl.cc b/chrome/browser/prefs/pref_notifier_impl.cc index 6d1dd2a..cdf67294 100644 --- a/chrome/browser/prefs/pref_notifier_impl.cc +++ b/chrome/browser/prefs/pref_notifier_impl.cc @@ -6,6 +6,7 @@ #include "base/stl_util-inl.h" #include "chrome/browser/prefs/pref_service.h" +#include "chrome/common/chrome_notification_types.h" #include "content/common/notification_observer.h" #include "content/common/notification_service.h" @@ -78,7 +79,7 @@ void PrefNotifierImpl::OnInitializationCompleted(bool succeeded) { DCHECK(CalledOnValidThread()); NotificationService::current()->Notify( - NotificationType::PREF_INITIALIZATION_COMPLETED, + chrome::NOTIFICATION_PREF_INITIALIZATION_COMPLETED, Source<PrefService>(pref_service_), Details<bool>(&succeeded)); } @@ -98,7 +99,7 @@ void PrefNotifierImpl::FireObservers(const std::string& path) { NotificationObserverList::Iterator it(*(observer_iterator->second)); NotificationObserver* observer; while ((observer = it.GetNext()) != NULL) { - observer->Observe(NotificationType::PREF_CHANGED, + observer->Observe(chrome::NOTIFICATION_PREF_CHANGED, Source<PrefService>(pref_service_), Details<const std::string>(&path)); } diff --git a/chrome/browser/prefs/pref_notifier_impl_unittest.cc b/chrome/browser/prefs/pref_notifier_impl_unittest.cc index c413e32..32d7f22 100644 --- a/chrome/browser/prefs/pref_notifier_impl_unittest.cc +++ b/chrome/browser/prefs/pref_notifier_impl_unittest.cc @@ -6,6 +6,7 @@ #include "chrome/browser/prefs/pref_observer_mock.h" #include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/prefs/pref_value_store.h" +#include "chrome/common/chrome_notification_types.h" #include "chrome/test/testing_pref_service.h" #include "content/common/notification_observer_mock.h" #include "content/common/notification_registrar.h" @@ -80,11 +81,10 @@ TEST_F(PrefNotifierTest, OnInitializationCompleted) { MockPrefNotifier notifier(&pref_service_); NotificationObserverMock observer; NotificationRegistrar registrar; - registrar.Add(&observer, NotificationType::PREF_INITIALIZATION_COMPLETED, + registrar.Add(&observer, chrome::NOTIFICATION_PREF_INITIALIZATION_COMPLETED, Source<PrefService>(&pref_service_)); EXPECT_CALL(observer, Observe( - Field(&NotificationType::value, - NotificationType::PREF_INITIALIZATION_COMPLETED), + int(chrome::NOTIFICATION_PREF_INITIALIZATION_COMPLETED), Source<PrefService>(&pref_service_), Property(&Details<bool>::ptr, testing::Pointee(true)))); notifier.OnInitializationCompleted(true); diff --git a/chrome/browser/prefs/pref_observer_mock.cc b/chrome/browser/prefs/pref_observer_mock.cc index a41ed5c..5d144b7 100644 --- a/chrome/browser/prefs/pref_observer_mock.cc +++ b/chrome/browser/prefs/pref_observer_mock.cc @@ -3,6 +3,7 @@ // found in the LICENSE file. #include "chrome/browser/prefs/pref_observer_mock.h" +#include "chrome/common/chrome_notification_types.h" PrefObserverMock::PrefObserverMock() {} @@ -11,7 +12,7 @@ PrefObserverMock::~PrefObserverMock() {} void PrefObserverMock::Expect(const PrefService* prefs, const std::string& pref_name, const Value* value) { - EXPECT_CALL(*this, Observe(NotificationType(NotificationType::PREF_CHANGED), + EXPECT_CALL(*this, Observe(int(chrome::NOTIFICATION_PREF_CHANGED), Source<PrefService>(prefs), Property(&Details<std::string>::ptr, Pointee(pref_name)))) diff --git a/chrome/browser/prefs/pref_observer_mock.h b/chrome/browser/prefs/pref_observer_mock.h index eac1c13..3ef7437 100644 --- a/chrome/browser/prefs/pref_observer_mock.h +++ b/chrome/browser/prefs/pref_observer_mock.h @@ -9,10 +9,10 @@ #include <string> #include "chrome/browser/prefs/pref_service.h" +#include "content/common/content_notification_types.h" #include "content/common/notification_details.h" #include "content/common/notification_observer.h" #include "content/common/notification_source.h" -#include "content/common/notification_type.h" #include "testing/gmock/include/gmock/gmock.h" using testing::Pointee; @@ -42,7 +42,7 @@ class PrefObserverMock : public NotificationObserver { PrefObserverMock(); virtual ~PrefObserverMock(); - MOCK_METHOD3(Observe, void(NotificationType type, + MOCK_METHOD3(Observe, void(int type, const NotificationSource& source, const NotificationDetails& details)); diff --git a/chrome/browser/prefs/pref_set_observer.cc b/chrome/browser/prefs/pref_set_observer.cc index 916769e..4ab741f 100644 --- a/chrome/browser/prefs/pref_set_observer.cc +++ b/chrome/browser/prefs/pref_set_observer.cc @@ -5,7 +5,7 @@ #include "chrome/browser/prefs/pref_set_observer.h" #include "chrome/common/pref_names.h" -#include "content/common/notification_type.h" +#include "content/common/content_notification_types.h" PrefSetObserver::PrefSetObserver(PrefService* pref_service, NotificationObserver* observer) @@ -69,7 +69,7 @@ PrefSetObserver* PrefSetObserver::CreateDefaultSearchPrefSetObserver( return pref_set; } -void PrefSetObserver::Observe(NotificationType type, +void PrefSetObserver::Observe(int type, const NotificationSource& source, const NotificationDetails& details) { if (observer_) diff --git a/chrome/browser/prefs/pref_set_observer.h b/chrome/browser/prefs/pref_set_observer.h index 40c38e5..2639462 100644 --- a/chrome/browser/prefs/pref_set_observer.h +++ b/chrome/browser/prefs/pref_set_observer.h @@ -44,7 +44,7 @@ class PrefSetObserver : public NotificationObserver { private: // Overridden from NotificationObserver. - virtual void Observe(NotificationType type, + virtual void Observe(int type, const NotificationSource& source, const NotificationDetails& details); diff --git a/chrome/browser/prefs/pref_set_observer_unittest.cc b/chrome/browser/prefs/pref_set_observer_unittest.cc index 49fc507..eb68d3f 100644 --- a/chrome/browser/prefs/pref_set_observer_unittest.cc +++ b/chrome/browser/prefs/pref_set_observer_unittest.cc @@ -3,6 +3,7 @@ // found in the LICENSE file. #include "chrome/browser/prefs/pref_set_observer.h" +#include "chrome/common/chrome_notification_types.h" #include "chrome/common/pref_names.h" #include "chrome/test/testing_pref_service.h" #include "content/common/notification_details.h" @@ -73,7 +74,7 @@ TEST_F(PrefSetObserverTest, Observe) { scoped_ptr<PrefSetObserver> pref_set(CreatePrefSetObserver(&observer)); EXPECT_CALL(observer, - Observe(NotificationType(NotificationType::PREF_CHANGED), + Observe(int(chrome::NOTIFICATION_PREF_CHANGED), Source<PrefService>(pref_service_.get()), PrefNameDetails(prefs::kHomePage))); pref_service_->SetUserPref(prefs::kHomePage, @@ -81,7 +82,7 @@ TEST_F(PrefSetObserverTest, Observe) { Mock::VerifyAndClearExpectations(&observer); EXPECT_CALL(observer, - Observe(NotificationType(NotificationType::PREF_CHANGED), + Observe(int(chrome::NOTIFICATION_PREF_CHANGED), Source<PrefService>(pref_service_.get()), PrefNameDetails(prefs::kHomePageIsNewTabPage))); pref_service_->SetUserPref(prefs::kHomePageIsNewTabPage, |