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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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 // Testing methods ---------------------------------------------------------- | 93 // Testing methods ---------------------------------------------------------- |
94 // | 94 // |
95 // The following methods should be used exclusively for writing unit tests. | 95 // The following methods should be used exclusively for writing unit tests. |
96 | 96 |
97 static scoped_ptr<NavigationHandle> CreateNavigationHandleForTesting( | 97 static scoped_ptr<NavigationHandle> CreateNavigationHandleForTesting( |
98 const GURL& url, | 98 const GURL& url, |
99 bool is_main_frame, | 99 bool is_main_frame, |
100 WebContents* web_contents); | 100 RenderFrameHost* render_frame_host); |
nasko
2015/10/02 22:09:45
Does it make sense to separate this test change in
Fabrice (no longer in Chrome)
2015/10/06 17:21:38
Done.
| |
101 | 101 |
102 // Registers a NavigationThrottle for tests. The throttle can | 102 // Registers a NavigationThrottle for tests. The throttle can |
103 // modify the request, pause the request or cancel the request. This will | 103 // modify the request, pause the request or cancel the request. This will |
104 // take ownership of the NavigationThrottle. | 104 // take ownership of the NavigationThrottle. |
105 // Note: in non-test cases, NavigationThrottles should not be added directly | 105 // Note: in non-test cases, NavigationThrottles should not be added directly |
106 // but returned by the implementation of | 106 // but returned by the implementation of |
107 // ContentBrowserClient::CreateThrottlesForNavigation. This ensures proper | 107 // ContentBrowserClient::CreateThrottlesForNavigation. This ensures proper |
108 // ordering of the throttles. | 108 // ordering of the throttles. |
109 virtual void RegisterThrottleForTesting( | 109 virtual void RegisterThrottleForTesting( |
110 scoped_ptr<NavigationThrottle> navigation_throttle) = 0; | 110 scoped_ptr<NavigationThrottle> navigation_throttle) = 0; |
(...skipping 10 matching lines...) Expand all Loading... | |
121 virtual NavigationThrottle::ThrottleCheckResult | 121 virtual NavigationThrottle::ThrottleCheckResult |
122 CallWillRedirectRequestForTesting(const GURL& new_url, | 122 CallWillRedirectRequestForTesting(const GURL& new_url, |
123 bool new_method_is_post, | 123 bool new_method_is_post, |
124 const GURL& new_referrer_url, | 124 const GURL& new_referrer_url, |
125 bool new_is_external_protocol) = 0; | 125 bool new_is_external_protocol) = 0; |
126 }; | 126 }; |
127 | 127 |
128 } // namespace content | 128 } // namespace content |
129 | 129 |
130 #endif // CONTENT_PUBLIC_BROWSER_NAVIGATION_HANDLE_H_ | 130 #endif // CONTENT_PUBLIC_BROWSER_NAVIGATION_HANDLE_H_ |
OLD | NEW |