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

Side by Side Diff: content/public/browser/navigation_handle.h

Issue 1414723008: Add a way to cancel deferred navigations in NavigationHandle (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments Created 5 years, 1 month 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 unified diff | Download patch
OLDNEW
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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 // (distinguished by |IsErrorPage|), and false for errors that leave the user 86 // (distinguished by |IsErrorPage|), and false for errors that leave the user
87 // on the previous page. 87 // on the previous page.
88 virtual bool HasCommitted() = 0; 88 virtual bool HasCommitted() = 0;
89 89
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 // Resumes a navigation that was previously deferred by a NavigationThrottle. 93 // Resumes a navigation that was previously deferred by a NavigationThrottle.
94 virtual void Resume() = 0; 94 virtual void Resume() = 0;
95 95
96 // Cancels a navigation that was previously deferred by a NavigationThrottle.
97 // |result| should be equal to NavigationThrottle::CANCEL or
98 // NavigationThrottle::CANCEL_AND_IGNORE.
99 virtual void CancelDeferredNavigation(
100 NavigationThrottle::ThrottleCheckResult result) = 0;
101
96 // Testing methods ---------------------------------------------------------- 102 // Testing methods ----------------------------------------------------------
97 // 103 //
98 // The following methods should be used exclusively for writing unit tests. 104 // The following methods should be used exclusively for writing unit tests.
99 105
100 static scoped_ptr<NavigationHandle> CreateNavigationHandleForTesting( 106 static scoped_ptr<NavigationHandle> CreateNavigationHandleForTesting(
101 const GURL& url, 107 const GURL& url,
102 RenderFrameHost* render_frame_host); 108 RenderFrameHost* render_frame_host);
103 109
104 // Registers a NavigationThrottle for tests. The throttle can 110 // Registers a NavigationThrottle for tests. The throttle can
105 // modify the request, pause the request or cancel the request. This will 111 // modify the request, pause the request or cancel the request. This will
(...skipping 17 matching lines...) Expand all
123 virtual NavigationThrottle::ThrottleCheckResult 129 virtual NavigationThrottle::ThrottleCheckResult
124 CallWillRedirectRequestForTesting(const GURL& new_url, 130 CallWillRedirectRequestForTesting(const GURL& new_url,
125 bool new_method_is_post, 131 bool new_method_is_post,
126 const GURL& new_referrer_url, 132 const GURL& new_referrer_url,
127 bool new_is_external_protocol) = 0; 133 bool new_is_external_protocol) = 0;
128 }; 134 };
129 135
130 } // namespace content 136 } // namespace content
131 137
132 #endif // CONTENT_PUBLIC_BROWSER_NAVIGATION_HANDLE_H_ 138 #endif // CONTENT_PUBLIC_BROWSER_NAVIGATION_HANDLE_H_
OLDNEW
« no previous file with comments | « content/browser/loader/navigation_resource_throttle.cc ('k') | content/public/browser/navigation_throttle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698