| 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 "content/common/content_export.h" | 8 #include "content/common/content_export.h" |
| 9 #include "content/public/browser/navigation_throttle.h" | 9 #include "content/public/browser/navigation_throttle.h" |
| 10 #include "content/public/common/referrer.h" | 10 #include "content/public/common/referrer.h" |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 // (distinguished by |IsErrorPage|), and false for errors that leave the user | 86 // (distinguished by |IsErrorPage|), and false for errors that leave the user |
| 87 // on the previous page. | 87 // on the previous page. |
| 88 virtual bool HasCommitted() = 0; | 88 virtual bool HasCommitted() = 0; |
| 89 | 89 |
| 90 // Whether the navigation resulted in an error page. | 90 // Whether the navigation resulted in an error page. |
| 91 virtual bool IsErrorPage() = 0; | 91 virtual bool IsErrorPage() = 0; |
| 92 | 92 |
| 93 // Resumes a navigation that was previously deferred by a NavigationThrottle. | 93 // Resumes a navigation that was previously deferred by a NavigationThrottle. |
| 94 virtual void Resume() = 0; | 94 virtual void Resume() = 0; |
| 95 | 95 |
| 96 // Cancels a navigation that was previously deferred by a NavigationThrottle. |
| 97 // |result| should be equal to NavigationThrottle::CANCEL or |
| 98 // NavigationThrottle::CANCEL_AND_IGNORE. |
| 99 virtual void CancelDeferredNavigation( |
| 100 NavigationThrottle::ThrottleCheckResult result) = 0; |
| 101 |
| 96 // Testing methods ---------------------------------------------------------- | 102 // Testing methods ---------------------------------------------------------- |
| 97 // | 103 // |
| 98 // The following methods should be used exclusively for writing unit tests. | 104 // The following methods should be used exclusively for writing unit tests. |
| 99 | 105 |
| 100 static scoped_ptr<NavigationHandle> CreateNavigationHandleForTesting( | 106 static scoped_ptr<NavigationHandle> CreateNavigationHandleForTesting( |
| 101 const GURL& url, | 107 const GURL& url, |
| 102 RenderFrameHost* render_frame_host); | 108 RenderFrameHost* render_frame_host); |
| 103 | 109 |
| 104 // Registers a NavigationThrottle for tests. The throttle can | 110 // Registers a NavigationThrottle for tests. The throttle can |
| 105 // modify the request, pause the request or cancel the request. This will | 111 // modify the request, pause the request or cancel the request. This will |
| (...skipping 17 matching lines...) Expand all Loading... |
| 123 virtual NavigationThrottle::ThrottleCheckResult | 129 virtual NavigationThrottle::ThrottleCheckResult |
| 124 CallWillRedirectRequestForTesting(const GURL& new_url, | 130 CallWillRedirectRequestForTesting(const GURL& new_url, |
| 125 bool new_method_is_post, | 131 bool new_method_is_post, |
| 126 const GURL& new_referrer_url, | 132 const GURL& new_referrer_url, |
| 127 bool new_is_external_protocol) = 0; | 133 bool new_is_external_protocol) = 0; |
| 128 }; | 134 }; |
| 129 | 135 |
| 130 } // namespace content | 136 } // namespace content |
| 131 | 137 |
| 132 #endif // CONTENT_PUBLIC_BROWSER_NAVIGATION_HANDLE_H_ | 138 #endif // CONTENT_PUBLIC_BROWSER_NAVIGATION_HANDLE_H_ |
| OLD | NEW |