| 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 #include "content/public/test/test_navigation_observer.h" | 5 #include "content/public/test/test_navigation_observer.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
| 10 #include "content/public/browser/notification_service.h" | 10 #include "content/public/browser/notification_service.h" |
| 11 #include "content/public/browser/notification_types.h" | 11 #include "content/public/browser/notification_types.h" |
| 12 #include "content/public/browser/render_view_host_observer.h" | 12 #include "content/public/browser/render_view_host_observer.h" |
| 13 #include "content/public/test/browser_test_utils.h" | |
| 14 #include "content/public/test/js_injection_ready_observer.h" | 13 #include "content/public/test/js_injection_ready_observer.h" |
| 14 #include "content/public/test/test_utils.h" |
| 15 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
| 16 | 16 |
| 17 namespace content { | 17 namespace content { |
| 18 | 18 |
| 19 // This class observes |render_view_host| and calls OnJsInjectionReady() of | 19 // This class observes |render_view_host| and calls OnJsInjectionReady() of |
| 20 // |js_injection_ready_observer| when the time is right to inject JavaScript | 20 // |js_injection_ready_observer| when the time is right to inject JavaScript |
| 21 // into the page. | 21 // into the page. |
| 22 class TestNavigationObserver::RVHOSendJS : public RenderViewHostObserver { | 22 class TestNavigationObserver::RVHOSendJS : public RenderViewHostObserver { |
| 23 public: | 23 public: |
| 24 RVHOSendJS(RenderViewHost* render_view_host, | 24 RVHOSendJS(RenderViewHost* render_view_host, |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 rvho_send_js_.reset(new RVHOSendJS( | 142 rvho_send_js_.reset(new RVHOSendJS( |
| 143 Source<RenderViewHost>(source).ptr(), | 143 Source<RenderViewHost>(source).ptr(), |
| 144 js_injection_ready_observer_)); | 144 js_injection_ready_observer_)); |
| 145 break; | 145 break; |
| 146 default: | 146 default: |
| 147 NOTREACHED(); | 147 NOTREACHED(); |
| 148 } | 148 } |
| 149 } | 149 } |
| 150 | 150 |
| 151 } // namespace content | 151 } // namespace content |
| OLD | NEW |