OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CONTENT_TEST_TEST_NAVIGATION_HANDLE_H_ |
| 6 #define CONTENT_TEST_TEST_NAVIGATION_HANDLE_H_ |
| 7 |
| 8 #include <string> |
| 9 |
| 10 #include "content/browser/frame_host/navigation_handle_impl.h" |
| 11 #include "content/public/test/navigation_handle_tester.h" |
| 12 |
| 13 namespace content { |
| 14 |
| 15 // A test version of the NavigationHandle that can be used to simulate various |
| 16 // navigation call sby embedders of content/. |
| 17 class TestNavigationHandle : public NavigationHandleImpl, |
| 18 public NavigationHandleTester { |
| 19 public: |
| 20 ~TestNavigationHandle() override; |
| 21 |
| 22 static TestNavigationHandle* Create(const GURL& url, |
| 23 const GURL& validated_url, |
| 24 const bool is_main_frame, |
| 25 NavigatorDelegate* delegate); |
| 26 |
| 27 // NavigationHandlerTester implementation. |
| 28 NavigationThrottle::ThrottleCheckResult SimulateWillStartRequest( |
| 29 bool is_post, |
| 30 const Referrer& sanitized_referrer, |
| 31 bool has_user_gesture, |
| 32 ui::PageTransition transition, |
| 33 bool is_external_protocol) override; |
| 34 NavigationThrottle::ThrottleCheckResult SimulateWillRedirectRequest( |
| 35 const GURL& new_url, |
| 36 const GURL& new_validated_url, |
| 37 bool new_method_is_post, |
| 38 const GURL& new_referrer_url, |
| 39 bool new_is_external_protocol) override; |
| 40 |
| 41 private: |
| 42 TestNavigationHandle(const GURL& url, |
| 43 const GURL& validated_url, |
| 44 const bool is_main_frame, |
| 45 NavigatorDelegate* delegate); |
| 46 }; |
| 47 |
| 48 } // namespace content |
| 49 |
| 50 #endif // CONTENT_TEST_TEST_NAVIGATION_HANDLE_H_ |
OLD | NEW |