| 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/test/test_frame_navigation_observer.h" | 5 #include "content/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 29 matching lines...) Expand all Loading... |
| 40 if (has_committed_) | 40 if (has_committed_) |
| 41 return; | 41 return; |
| 42 | 42 |
| 43 wait_for_commit_ = true; | 43 wait_for_commit_ = true; |
| 44 message_loop_runner_->Run(); | 44 message_loop_runner_->Run(); |
| 45 } | 45 } |
| 46 | 46 |
| 47 void TestFrameNavigationObserver::DidStartProvisionalLoadForFrame( | 47 void TestFrameNavigationObserver::DidStartProvisionalLoadForFrame( |
| 48 RenderFrameHost* render_frame_host, | 48 RenderFrameHost* render_frame_host, |
| 49 const GURL& validated_url, | 49 const GURL& validated_url, |
| 50 bool is_error_page, | 50 bool is_error_page) { |
| 51 bool is_iframe_srcdoc) { | |
| 52 RenderFrameHostImpl* rfh = | 51 RenderFrameHostImpl* rfh = |
| 53 static_cast<RenderFrameHostImpl*>(render_frame_host); | 52 static_cast<RenderFrameHostImpl*>(render_frame_host); |
| 54 if (rfh->frame_tree_node()->frame_tree_node_id() == frame_tree_node_id_) { | 53 if (rfh->frame_tree_node()->frame_tree_node_id() == frame_tree_node_id_) { |
| 55 navigation_started_ = true; | 54 navigation_started_ = true; |
| 56 has_committed_ = false; | 55 has_committed_ = false; |
| 57 } | 56 } |
| 58 } | 57 } |
| 59 | 58 |
| 60 void TestFrameNavigationObserver::DidCommitProvisionalLoadForFrame( | 59 void TestFrameNavigationObserver::DidCommitProvisionalLoadForFrame( |
| 61 RenderFrameHost* render_frame_host, | 60 RenderFrameHost* render_frame_host, |
| (...skipping 14 matching lines...) Expand all Loading... |
| 76 | 75 |
| 77 void TestFrameNavigationObserver::DidStopLoading() { | 76 void TestFrameNavigationObserver::DidStopLoading() { |
| 78 if (!navigation_started_) | 77 if (!navigation_started_) |
| 79 return; | 78 return; |
| 80 | 79 |
| 81 navigation_started_ = false; | 80 navigation_started_ = false; |
| 82 message_loop_runner_->Quit(); | 81 message_loop_runner_->Quit(); |
| 83 } | 82 } |
| 84 | 83 |
| 85 } // namespace content | 84 } // namespace content |
| OLD | NEW |