Chromium Code Reviews| Index: chrome/test/test_tab_strip_model_observer.h |
| diff --git a/chrome/test/test_tab_strip_model_observer.h b/chrome/test/test_tab_strip_model_observer.h |
| index c384e45a55f06e4f02b0e606f1b15ea23da0122a..39890a926bb9004c26269d453761a4d63f58ce45 100644 |
| --- a/chrome/test/test_tab_strip_model_observer.h |
| +++ b/chrome/test/test_tab_strip_model_observer.h |
| @@ -8,8 +8,7 @@ |
| #include "base/compiler_specific.h" |
| #include "chrome/browser/tabs/tab_strip_model_observer.h" |
| -#include "content/common/notification_observer.h" |
| -#include "content/common/notification_registrar.h" |
| +#include "chrome/test/test_navigation_observer.h" |
| class TabStripModel; |
| @@ -20,60 +19,25 @@ class TabStripModel; |
| // javascript before the webui page loads by calling back through the |
| // TestTabStripModelObserver::LoadStartObserver when the new page starts |
| // loading. |
| -class TestTabStripModelObserver : public TabStripModelObserver, |
| - public NotificationObserver { |
| +class TestTabStripModelObserver : public TestNavigationObserver, |
|
sky
2011/07/11 22:47:42
Did you consider making this have a TestNavigation
Sheridan Rawlins
2011/07/12 04:37:49
Yeah, I took a look, but it didn't seem that much
|
| + public TabStripModelObserver { |
| public: |
| - class LoadStartObserver { |
| - public: |
| - LoadStartObserver(); |
| - virtual ~LoadStartObserver(); |
| - |
| - // Called to indicate page load starting. |
| - virtual void OnLoadStart() = 0; |
| - }; |
| - |
| // Observe the |tab_strip_model|, which may not be NULL. If |
| // |load_start_observer| is non-NULL, notify when the page load starts. |
| - TestTabStripModelObserver(TabStripModel* tab_strip_model, |
| - LoadStartObserver* load_start_observer); |
| + TestTabStripModelObserver( |
| + TabStripModel* tab_strip_model, |
| + JsInjectionReadyObserver* js_injection_ready_observer); |
| virtual ~TestTabStripModelObserver(); |
| - // Run the UI message loop until |done_| becomes true. |
| - void WaitForObservation(); |
| - |
| private: |
| // TabStripModelObserver: |
| virtual void TabInsertedAt(TabContentsWrapper* contents, int index, |
| bool foreground) OVERRIDE; |
| - // NotificationObserver: |
| - virtual void Observe(int type, const NotificationSource& source, |
| - const NotificationDetails& details) OVERRIDE; |
| - |
| - NotificationRegistrar registrar_; |
| - |
| - // If true the navigation has started. |
| - bool navigation_started_; |
| - |
| - // The number of navigations that have been completed. |
| - int navigations_completed_; |
| - |
| - // The number of navigations to wait for. |
| - int number_of_navigations_; |
| - |
| // |tab_strip_model_| is the object this observes. The constructor will |
| // register this as an observer, and the destructor will remove the observer. |
| TabStripModel* tab_strip_model_; |
| - // Observer to take some action when the page load starts. |
| - LoadStartObserver* load_start_observer_; |
| - |
| - // |done_| will get set when this object observes a TabStripModel event. |
| - bool done_; |
| - |
| - // |running_| will be true during WaitForObservation until |done_| is true. |
| - bool running_; |
| - |
| DISALLOW_COPY_AND_ASSIGN(TestTabStripModelObserver); |
| }; |