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 #include "content/public/test/navigation_handle_tester.h" |
| 6 |
| 7 #include "content/browser/frame_host/navigator.h" |
| 8 #include "content/browser/web_contents/web_contents_impl.h" |
| 9 #include "content/public/browser/navigation_handle.h" |
| 10 #include "content/public/browser/web_contents.h" |
| 11 #include "content/test/test_navigation_handle.h" |
| 12 |
| 13 namespace content { |
| 14 |
| 15 // static |
| 16 NavigationHandleTester* NavigationHandleTester::For( |
| 17 NavigationHandle* navigation_handle) { |
| 18 return static_cast<TestNavigationHandle*>(navigation_handle); |
| 19 } |
| 20 |
| 21 // static |
| 22 NavigationHandle* NavigationHandleTester::CreateTestNavigationHandle( |
| 23 const GURL& url, |
| 24 const GURL& validated_url, |
| 25 bool is_main_frame, |
| 26 WebContents* web_contents) { |
| 27 return TestNavigationHandle::Create( |
| 28 url, validated_url, is_main_frame, |
| 29 static_cast<WebContentsImpl*>(web_contents) |
| 30 ->GetMainFrame() |
| 31 ->frame_tree_node() |
| 32 ->navigator() |
| 33 ->GetDelegate()); |
| 34 } |
| 35 |
| 36 } // namespace content |
OLD | NEW |