| 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 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "chrome/test/base/ui_test_utils.h" | 10 #include "base/memory/ref_counted.h" |
| 11 #include "content/public/browser/notification_observer.h" | 11 #include "content/public/browser/notification_observer.h" |
| 12 #include "content/public/browser/notification_registrar.h" | 12 #include "content/public/browser/notification_registrar.h" |
| 13 #include "ui/web_dialogs/web_dialog_observer.h" | 13 #include "ui/web_dialogs/web_dialog_observer.h" |
| 14 | 14 |
| 15 | 15 |
| 16 namespace content { | 16 namespace content { |
| 17 class JsInjectionReadyObserver; | 17 class JsInjectionReadyObserver; |
| 18 class MessageLoopRunner; |
| 18 class RenderViewHost; | 19 class RenderViewHost; |
| 19 class WebUI; | 20 class WebUI; |
| 20 } | 21 } |
| 21 | 22 |
| 22 // For browser_tests, which run on the UI thread, run a second message | 23 // For browser_tests, which run on the UI thread, run a second message |
| 23 // MessageLoop to detect WebDialog creation and quit when the constructed | 24 // MessageLoop to detect WebDialog creation and quit when the constructed |
| 24 // WebUI instance is captured and ready. | 25 // WebUI instance is captured and ready. |
| 25 class TestWebDialogObserver : public content::NotificationObserver, | 26 class TestWebDialogObserver : public content::NotificationObserver, |
| 26 public ui::WebDialogObserver { | 27 public ui::WebDialogObserver { |
| 27 public: | 28 public: |
| (...skipping 20 matching lines...) Expand all Loading... |
| 48 const content::NotificationDetails& details) OVERRIDE; | 49 const content::NotificationDetails& details) OVERRIDE; |
| 49 | 50 |
| 50 content::NotificationRegistrar registrar_; | 51 content::NotificationRegistrar registrar_; |
| 51 | 52 |
| 52 // Observer to take some action when the dialog is ready for JavaScript | 53 // Observer to take some action when the dialog is ready for JavaScript |
| 53 // injection. | 54 // injection. |
| 54 content::JsInjectionReadyObserver* js_injection_ready_observer_; | 55 content::JsInjectionReadyObserver* js_injection_ready_observer_; |
| 55 content::WebUI* web_ui_; | 56 content::WebUI* web_ui_; |
| 56 bool done_; | 57 bool done_; |
| 57 bool running_; | 58 bool running_; |
| 58 scoped_refptr<ui_test_utils::MessageLoopRunner> message_loop_runner_; | 59 scoped_refptr<content::MessageLoopRunner> message_loop_runner_; |
| 59 | 60 |
| 60 DISALLOW_COPY_AND_ASSIGN(TestWebDialogObserver); | 61 DISALLOW_COPY_AND_ASSIGN(TestWebDialogObserver); |
| 61 }; | 62 }; |
| 62 | 63 |
| 63 #endif // CHROME_TEST_BASE_TEST_WEB_DIALOG_OBSERVER_H_ | 64 #endif // CHROME_TEST_BASE_TEST_WEB_DIALOG_OBSERVER_H_ |
| OLD | NEW |