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 WebContents* web_contents, |
101 int service_worker_provider_id); | |
clamy
2015/10/01 12:41:27
This _should not_ be exposed outside of content, h
Fabrice (no longer in Chrome)
2015/10/01 18:29:56
I removed it, since this is for unit tests, the va
| |
101 | 102 |
102 // Registers a NavigationThrottle for tests. The throttle can | 103 // Registers a NavigationThrottle for tests. The throttle can |
103 // modify the request, pause the request or cancel the request. This will | 104 // modify the request, pause the request or cancel the request. This will |
104 // take ownership of the NavigationThrottle. | 105 // take ownership of the NavigationThrottle. |
105 // Note: in non-test cases, NavigationThrottles should not be added directly | 106 // Note: in non-test cases, NavigationThrottles should not be added directly |
106 // but returned by the implementation of | 107 // but returned by the implementation of |
107 // ContentBrowserClient::CreateThrottlesForNavigation. This ensures proper | 108 // ContentBrowserClient::CreateThrottlesForNavigation. This ensures proper |
108 // ordering of the throttles. | 109 // ordering of the throttles. |
109 virtual void RegisterThrottleForTesting( | 110 virtual void RegisterThrottleForTesting( |
110 scoped_ptr<NavigationThrottle> navigation_throttle) = 0; | 111 scoped_ptr<NavigationThrottle> navigation_throttle) = 0; |
(...skipping 10 matching lines...) Expand all Loading... | |
121 virtual NavigationThrottle::ThrottleCheckResult | 122 virtual NavigationThrottle::ThrottleCheckResult |
122 CallWillRedirectRequestForTesting(const GURL& new_url, | 123 CallWillRedirectRequestForTesting(const GURL& new_url, |
123 bool new_method_is_post, | 124 bool new_method_is_post, |
124 const GURL& new_referrer_url, | 125 const GURL& new_referrer_url, |
125 bool new_is_external_protocol) = 0; | 126 bool new_is_external_protocol) = 0; |
126 }; | 127 }; |
127 | 128 |
128 } // namespace content | 129 } // namespace content |
129 | 130 |
130 #endif // CONTENT_PUBLIC_BROWSER_NAVIGATION_HANDLE_H_ | 131 #endif // CONTENT_PUBLIC_BROWSER_NAVIGATION_HANDLE_H_ |
OLD | NEW |