From bfd04a62ce610d7bb61dbb78811dccbed23589b7 Mon Sep 17 00:00:00 2001 From: "brettw@chromium.org" Date: Sun, 1 Feb 2009 18:16:56 +0000 Subject: Remove most header file dependencies on the notification type list. It is really painful to add more types, since lots of headers include the notification service to derive from the notification observer. This splits that out, so much less of the project should end up including notification_types.h ---Paths modified but not in any changelist: Review URL: http://codereview.chromium.org/19744 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9020 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/test/in_process_browser_test.cc | 6 ++++-- chrome/test/in_process_browser_test.h | 2 +- chrome/test/test_notification_tracker.cc | 4 ++-- chrome/test/testing_browser_process.h | 7 +++---- chrome/test/ui_test_utils.cc | 11 ++++++----- 5 files changed, 16 insertions(+), 14 deletions(-) (limited to 'chrome/test') diff --git a/chrome/test/in_process_browser_test.cc b/chrome/test/in_process_browser_test.cc index 581ddab..6d6cc96 100644 --- a/chrome/test/in_process_browser_test.cc +++ b/chrome/test/in_process_browser_test.cc @@ -107,7 +107,7 @@ void InProcessBrowserTest::TearDown() { void InProcessBrowserTest::Observe(NotificationType type, const NotificationSource& source, const NotificationDetails& details) { - if (type == NOTIFY_BROWSER_CLOSED) { + if (type == NotificationType::BROWSER_CLOSED) { DCHECK(Source(source).ptr() == browser_); browser_ = NULL; } else { @@ -161,7 +161,9 @@ void InProcessBrowserTest::RunTestOnMainThreadLoop() { browser_ = CreateBrowser(profile); - registrar_.Add(this, NOTIFY_BROWSER_CLOSED, Source(browser_)); + registrar_.Add(this, + NotificationType::BROWSER_CLOSED, + Source(browser_)); RunTestOnMainThread(); diff --git a/chrome/test/in_process_browser_test.h b/chrome/test/in_process_browser_test.h index fb8bd9d..230b8df 100644 --- a/chrome/test/in_process_browser_test.h +++ b/chrome/test/in_process_browser_test.h @@ -7,7 +7,7 @@ #include "chrome/app/scoped_ole_initializer.h" #include "chrome/common/notification_registrar.h" -#include "chrome/common/notification_service.h" +#include "chrome/common/notification_observer.h" #include "net/url_request/url_request_unittest.h" #include "testing/gtest/include/gtest/gtest.h" diff --git a/chrome/test/test_notification_tracker.cc b/chrome/test/test_notification_tracker.cc index 84f8869..d89ea16 100644 --- a/chrome/test/test_notification_tracker.cc +++ b/chrome/test/test_notification_tracker.cc @@ -3,10 +3,10 @@ // found in the LICENSE file. #include "chrome/test/test_notification_tracker.h" -#include "chrome/common/notification_types.h" +#include "chrome/common/notification_service.h" TestNotificationTracker::Event::Event() - : type(NOTIFY_ALL), + : type(NotificationType::ALL), source(NotificationService::AllSources()), details(NotificationService::NoDetails()) { } diff --git a/chrome/test/testing_browser_process.h b/chrome/test/testing_browser_process.h index 76f349c..d3a337b 100644 --- a/chrome/test/testing_browser_process.h +++ b/chrome/test/testing_browser_process.h @@ -7,8 +7,8 @@ // keep the profile clean. Clients of this class must handle the NULL return // value, however. -#ifndef CHROME_TEST_TESTING_BROWSER_PROCESS_H__ -#define CHROME_TEST_TESTING_BROWSER_PROCESS_H__ +#ifndef CHROME_TEST_TESTING_BROWSER_PROCESS_H_ +#define CHROME_TEST_TESTING_BROWSER_PROCESS_H_ #include "build/build_config.h" @@ -130,5 +130,4 @@ class TestingBrowserProcess : public BrowserProcess { DISALLOW_COPY_AND_ASSIGN(TestingBrowserProcess); }; -#endif // CHROME_TEST_TESTING_BROWSER_PROCESS_H__ - +#endif // CHROME_TEST_TESTING_BROWSER_PROCESS_H_ diff --git a/chrome/test/ui_test_utils.cc b/chrome/test/ui_test_utils.cc index 07016f7..1293f72 100644 --- a/chrome/test/ui_test_utils.cc +++ b/chrome/test/ui_test_utils.cc @@ -21,11 +21,11 @@ class NavigationNotificationObserver : public NotificationObserver { public: explicit NavigationNotificationObserver(NavigationController* controller) : navigation_started_(false) { - registrar_.Add(this, NOTIFY_NAV_ENTRY_COMMITTED, + registrar_.Add(this, NotificationType::NAV_ENTRY_COMMITTED, Source(controller)); - registrar_.Add(this, NOTIFY_LOAD_START, + registrar_.Add(this, NotificationType::LOAD_START, Source(controller)); - registrar_.Add(this, NOTIFY_LOAD_STOP, + registrar_.Add(this, NotificationType::LOAD_STOP, Source(controller)); RunMessageLoop(); } @@ -33,9 +33,10 @@ class NavigationNotificationObserver : public NotificationObserver { virtual void Observe(NotificationType type, const NotificationSource& source, const NotificationDetails& details) { - if (type == NOTIFY_NAV_ENTRY_COMMITTED || type == NOTIFY_LOAD_START) { + if (type == NotificationType::NAV_ENTRY_COMMITTED || + type == NotificationType::LOAD_START) { navigation_started_ = true; - } else if (type == NOTIFY_LOAD_STOP) { + } else if (type == NotificationType::LOAD_STOP) { if (navigation_started_) { navigation_started_ = false; MessageLoopForUI::current()->Quit(); -- cgit v1.1