| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 CONTENT_PUBLIC_BROWSER_NAVIGATION_HANDLE_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_NAVIGATION_HANDLE_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_NAVIGATION_HANDLE_H_ | 6 #define CONTENT_PUBLIC_BROWSER_NAVIGATION_HANDLE_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 | 253 |
| 254 // Testing methods ---------------------------------------------------------- | 254 // Testing methods ---------------------------------------------------------- |
| 255 // | 255 // |
| 256 // The following methods should be used exclusively for writing unit tests. | 256 // The following methods should be used exclusively for writing unit tests. |
| 257 | 257 |
| 258 static std::unique_ptr<NavigationHandle> CreateNavigationHandleForTesting( | 258 static std::unique_ptr<NavigationHandle> CreateNavigationHandleForTesting( |
| 259 const GURL& url, | 259 const GURL& url, |
| 260 RenderFrameHost* render_frame_host, | 260 RenderFrameHost* render_frame_host, |
| 261 bool committed = false, | 261 bool committed = false, |
| 262 net::Error error = net::OK, | 262 net::Error error = net::OK, |
| 263 bool is_same_page = false); | 263 bool is_same_document = false); |
| 264 | 264 |
| 265 // Registers a NavigationThrottle for tests. The throttle can | 265 // Registers a NavigationThrottle for tests. The throttle can |
| 266 // modify the request, pause the request or cancel the request. This will | 266 // modify the request, pause the request or cancel the request. This will |
| 267 // take ownership of the NavigationThrottle. | 267 // take ownership of the NavigationThrottle. |
| 268 // Note: in non-test cases, NavigationThrottles should not be added directly | 268 // Note: in non-test cases, NavigationThrottles should not be added directly |
| 269 // but returned by the implementation of | 269 // but returned by the implementation of |
| 270 // ContentBrowserClient::CreateThrottlesForNavigation. This ensures proper | 270 // ContentBrowserClient::CreateThrottlesForNavigation. This ensures proper |
| 271 // ordering of the throttles. | 271 // ordering of the throttles. |
| 272 virtual void RegisterThrottleForTesting( | 272 virtual void RegisterThrottleForTesting( |
| 273 std::unique_ptr<NavigationThrottle> navigation_throttle) = 0; | 273 std::unique_ptr<NavigationThrottle> navigation_throttle) = 0; |
| (...skipping 24 matching lines...) Expand all Loading... |
| 298 | 298 |
| 299 // The NavigationData that the embedder returned from | 299 // The NavigationData that the embedder returned from |
| 300 // ResourceDispatcherHostDelegate::GetNavigationData during commit. This will | 300 // ResourceDispatcherHostDelegate::GetNavigationData during commit. This will |
| 301 // be a clone of the NavigationData. | 301 // be a clone of the NavigationData. |
| 302 virtual NavigationData* GetNavigationData() = 0; | 302 virtual NavigationData* GetNavigationData() = 0; |
| 303 }; | 303 }; |
| 304 | 304 |
| 305 } // namespace content | 305 } // namespace content |
| 306 | 306 |
| 307 #endif // CONTENT_PUBLIC_BROWSER_NAVIGATION_HANDLE_H_ | 307 #endif // CONTENT_PUBLIC_BROWSER_NAVIGATION_HANDLE_H_ |
| OLD | NEW |