Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Unified Diff: content/public/test/navigation_handle_tester.cc

Issue 1269813002: Add a NavigationThrottle to the public content/ interface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@navigation-api
Patch Set: Addressed comments Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/public/test/navigation_handle_tester.cc
diff --git a/content/public/test/navigation_handle_tester.cc b/content/public/test/navigation_handle_tester.cc
new file mode 100644
index 0000000000000000000000000000000000000000..a2788e23eae46b69208900aa11db3534440630c7
--- /dev/null
+++ b/content/public/test/navigation_handle_tester.cc
@@ -0,0 +1,36 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "content/public/test/navigation_handle_tester.h"
+
+#include "content/browser/frame_host/navigator.h"
+#include "content/browser/web_contents/web_contents_impl.h"
+#include "content/public/browser/navigation_handle.h"
+#include "content/public/browser/web_contents.h"
+#include "content/test/test_navigation_handle.h"
+
+namespace content {
+
+// static
+NavigationHandleTester* NavigationHandleTester::For(
+ NavigationHandle* navigation_handle) {
+ return static_cast<TestNavigationHandle*>(navigation_handle);
+}
+
+// static
+NavigationHandle* NavigationHandleTester::CreateTestNavigationHandle(
+ const GURL& url,
+ const GURL& validated_url,
+ bool is_main_frame,
+ WebContents* web_contents) {
+ return TestNavigationHandle::Create(
+ url, validated_url, is_main_frame,
+ static_cast<WebContentsImpl*>(web_contents)
+ ->GetMainFrame()
+ ->frame_tree_node()
+ ->navigator()
+ ->GetDelegate());
+}
+
+} // namespace content

Powered by Google App Engine
This is Rietveld 408576698