OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_frame_navigation_observer.h" | 5 #include "content/public/test/test_frame_navigation_observer.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 if (has_committed_) | 52 if (has_committed_) |
53 return; | 53 return; |
54 | 54 |
55 wait_for_commit_ = true; | 55 wait_for_commit_ = true; |
56 message_loop_runner_->Run(); | 56 message_loop_runner_->Run(); |
57 } | 57 } |
58 | 58 |
59 void TestFrameNavigationObserver::DidStartProvisionalLoadForFrame( | 59 void TestFrameNavigationObserver::DidStartProvisionalLoadForFrame( |
60 RenderFrameHost* render_frame_host, | 60 RenderFrameHost* render_frame_host, |
61 const GURL& validated_url, | 61 const GURL& validated_url, |
62 bool is_error_page) { | 62 bool is_error_page, |
| 63 bool is_iframe_srcdoc) { |
63 RenderFrameHostImpl* rfh = | 64 RenderFrameHostImpl* rfh = |
64 static_cast<RenderFrameHostImpl*>(render_frame_host); | 65 static_cast<RenderFrameHostImpl*>(render_frame_host); |
65 if (rfh->frame_tree_node()->frame_tree_node_id() == frame_tree_node_id_) { | 66 if (rfh->frame_tree_node()->frame_tree_node_id() == frame_tree_node_id_) { |
66 navigation_started_ = true; | 67 navigation_started_ = true; |
67 has_committed_ = false; | 68 has_committed_ = false; |
68 } | 69 } |
69 } | 70 } |
70 | 71 |
71 void TestFrameNavigationObserver::DidCommitProvisionalLoadForFrame( | 72 void TestFrameNavigationObserver::DidCommitProvisionalLoadForFrame( |
72 RenderFrameHost* render_frame_host, | 73 RenderFrameHost* render_frame_host, |
(...skipping 14 matching lines...) Expand all Loading... |
87 | 88 |
88 void TestFrameNavigationObserver::DidStopLoading() { | 89 void TestFrameNavigationObserver::DidStopLoading() { |
89 if (!navigation_started_) | 90 if (!navigation_started_) |
90 return; | 91 return; |
91 | 92 |
92 navigation_started_ = false; | 93 navigation_started_ = false; |
93 message_loop_runner_->Quit(); | 94 message_loop_runner_->Quit(); |
94 } | 95 } |
95 | 96 |
96 } // namespace content | 97 } // namespace content |
OLD | NEW |