| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_TEST_BASE_TEST_WEB_DIALOG_OBSERVER_H_ | 5 #ifndef CHROME_TEST_BASE_TEST_WEB_DIALOG_OBSERVER_H_ |
| 6 #define CHROME_TEST_BASE_TEST_WEB_DIALOG_OBSERVER_H_ | 6 #define CHROME_TEST_BASE_TEST_WEB_DIALOG_OBSERVER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 11 #include "chrome/browser/ui/webui/web_dialog_observer.h" | |
| 12 #include "content/public/browser/notification_observer.h" | 11 #include "content/public/browser/notification_observer.h" |
| 13 #include "content/public/browser/notification_registrar.h" | 12 #include "content/public/browser/notification_registrar.h" |
| 13 #include "ui/web_dialogs/web_dialog_observer.h" |
| 14 | 14 |
| 15 class JsInjectionReadyObserver; | 15 class JsInjectionReadyObserver; |
| 16 | 16 |
| 17 namespace content { | 17 namespace content { |
| 18 class RenderViewHost; | 18 class RenderViewHost; |
| 19 class WebUI; | 19 class WebUI; |
| 20 } | 20 } |
| 21 | 21 |
| 22 // For browser_tests, which run on the UI thread, run a second message | 22 // For browser_tests, which run on the UI thread, run a second message |
| 23 // MessageLoop to detect WebDialog creation and quit when the constructed | 23 // MessageLoop to detect WebDialog creation and quit when the constructed |
| 24 // WebUI instance is captured and ready. | 24 // WebUI instance is captured and ready. |
| 25 class TestWebDialogObserver : public content::NotificationObserver, | 25 class TestWebDialogObserver : public content::NotificationObserver, |
| 26 public WebDialogObserver { | 26 public ui::WebDialogObserver { |
| 27 public: | 27 public: |
| 28 // Create and register a new TestWebDialogObserver. If | 28 // Create and register a new TestWebDialogObserver. If |
| 29 // |js_injection_ready_observer| is non-NULL, notify it as soon as the RVH is | 29 // |js_injection_ready_observer| is non-NULL, notify it as soon as the RVH is |
| 30 // available. | 30 // available. |
| 31 explicit TestWebDialogObserver( | 31 explicit TestWebDialogObserver( |
| 32 JsInjectionReadyObserver* js_injection_ready_observer); | 32 JsInjectionReadyObserver* js_injection_ready_observer); |
| 33 virtual ~TestWebDialogObserver(); | 33 virtual ~TestWebDialogObserver(); |
| 34 | 34 |
| 35 // Overridden from WebDialogObserver: | 35 // Overridden from WebDialogObserver: |
| 36 virtual void OnDialogShown( | 36 virtual void OnDialogShown( |
| (...skipping 16 matching lines...) Expand all Loading... |
| 53 // injection. | 53 // injection. |
| 54 JsInjectionReadyObserver* js_injection_ready_observer_; | 54 JsInjectionReadyObserver* js_injection_ready_observer_; |
| 55 content::WebUI* web_ui_; | 55 content::WebUI* web_ui_; |
| 56 bool done_; | 56 bool done_; |
| 57 bool running_; | 57 bool running_; |
| 58 | 58 |
| 59 DISALLOW_COPY_AND_ASSIGN(TestWebDialogObserver); | 59 DISALLOW_COPY_AND_ASSIGN(TestWebDialogObserver); |
| 60 }; | 60 }; |
| 61 | 61 |
| 62 #endif // CHROME_TEST_BASE_TEST_WEB_DIALOG_OBSERVER_H_ | 62 #endif // CHROME_TEST_BASE_TEST_WEB_DIALOG_OBSERVER_H_ |
| OLD | NEW |