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/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "content/browser/web_contents/web_contents_impl.h" | 9 #include "content/browser/web_contents/web_contents_impl.h" |
10 #include "content/public/browser/navigation_handle.h" | 10 #include "content/public/browser/navigation_handle.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 | 38 |
39 void DidStartLoading() override { | 39 void DidStartLoading() override { |
40 parent_->OnDidStartLoading(web_contents()); | 40 parent_->OnDidStartLoading(web_contents()); |
41 } | 41 } |
42 | 42 |
43 void DidStopLoading() override { | 43 void DidStopLoading() override { |
44 parent_->OnDidStopLoading(web_contents()); | 44 parent_->OnDidStopLoading(web_contents()); |
45 } | 45 } |
46 | 46 |
47 void DidStartNavigation(NavigationHandle* navigation_handle) override { | 47 void DidStartNavigation(NavigationHandle* navigation_handle) override { |
48 if (navigation_handle->IsSamePage()) | 48 if (navigation_handle->IsSameDocument()) |
49 return; | 49 return; |
50 | 50 |
51 parent_->OnDidStartNavigation(); | 51 parent_->OnDidStartNavigation(); |
52 } | 52 } |
53 | 53 |
54 void DidFinishNavigation(NavigationHandle* navigation_handle) override { | 54 void DidFinishNavigation(NavigationHandle* navigation_handle) override { |
55 if (!navigation_handle->HasCommitted()) | 55 if (!navigation_handle->HasCommitted()) |
56 return; | 56 return; |
57 | 57 |
58 parent_->OnDidFinishNavigation(navigation_handle->IsErrorPage(), | 58 parent_->OnDidFinishNavigation(navigation_handle->IsErrorPage(), |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 last_navigation_succeeded_ = false; | 154 last_navigation_succeeded_ = false; |
155 } | 155 } |
156 | 156 |
157 void TestNavigationObserver::OnDidFinishNavigation(bool is_error_page, | 157 void TestNavigationObserver::OnDidFinishNavigation(bool is_error_page, |
158 const GURL& url) { | 158 const GURL& url) { |
159 last_navigation_url_ = url; | 159 last_navigation_url_ = url; |
160 last_navigation_succeeded_ = !is_error_page; | 160 last_navigation_succeeded_ = !is_error_page; |
161 } | 161 } |
162 | 162 |
163 } // namespace content | 163 } // namespace content |
OLD | NEW |