| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2011 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 #ifndef CHROME_TEST_TEST_TAB_STRIP_MODEL_OBSERVER_H_ | |
| 6 #define CHROME_TEST_TEST_TAB_STRIP_MODEL_OBSERVER_H_ | |
| 7 #pragma once | |
| 8 | |
| 9 #include "base/compiler_specific.h" | |
| 10 #include "chrome/browser/tabs/tab_strip_model_observer.h" | |
| 11 #include "chrome/test/test_navigation_observer.h" | |
| 12 | |
| 13 class TabStripModel; | |
| 14 | |
| 15 // In order to support testing of print preview, we need to wait for the tab to | |
| 16 // be inserted, and then observe notifications on the newly added tab's | |
| 17 // controller to wait for it to be loaded. To support tests registering | |
| 18 // javascript WebUI handlers, we need to inject the framework & registration | |
| 19 // javascript before the webui page loads by calling back through the | |
| 20 // TestTabStripModelObserver::LoadStartObserver when the new page starts | |
| 21 // loading. | |
| 22 class TestTabStripModelObserver : public TestNavigationObserver, | |
| 23 public TabStripModelObserver { | |
| 24 public: | |
| 25 // Observe the |tab_strip_model|, which may not be NULL. If | |
| 26 // |load_start_observer| is non-NULL, notify when the page load starts. | |
| 27 TestTabStripModelObserver( | |
| 28 TabStripModel* tab_strip_model, | |
| 29 JsInjectionReadyObserver* js_injection_ready_observer); | |
| 30 virtual ~TestTabStripModelObserver(); | |
| 31 | |
| 32 private: | |
| 33 // TabStripModelObserver: | |
| 34 virtual void TabInsertedAt(TabContentsWrapper* contents, int index, | |
| 35 bool foreground) OVERRIDE; | |
| 36 | |
| 37 // |tab_strip_model_| is the object this observes. The constructor will | |
| 38 // register this as an observer, and the destructor will remove the observer. | |
| 39 TabStripModel* tab_strip_model_; | |
| 40 | |
| 41 DISALLOW_COPY_AND_ASSIGN(TestTabStripModelObserver); | |
| 42 }; | |
| 43 | |
| 44 #endif // CHROME_TEST_TEST_TAB_STRIP_MODEL_OBSERVER_H_ | |
| OLD | NEW |