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

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

Issue 1269813002: Add a NavigationThrottle to the public content/ interface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@navigation-api
Patch Set: Removed TestNavigationHandle + pointer to WebContents 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 unified diff | Download patch
OLDNEW
(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_PUBLIC_BROWSER_NAVIGATION_THROTTLE_H_
6 #define CONTENT_PUBLIC_BROWSER_NAVIGATION_THROTTLE_H_
7
8 #include "content/common/content_export.h"
9
10 namespace content {
11 class NavigationHandle;
12
13 // A NavigationThrottle tracks and allows interaction with a navigation on the
14 // UI thread.
15 class CONTENT_EXPORT NavigationThrottle {
16 public:
17 // This is returned to the NavigationHandle to allow the navigation to
18 // proceed, or to cancel it.
19 enum ThrottleCheckResult {
20 PROCEED,
21 CANCEL_AND_IGNORE,
22 };
23
24 NavigationThrottle(NavigationHandle* navigation_handle);
25 virtual ~NavigationThrottle();
26
27 // Called when a network request is about to be made for this navigation.
28 virtual ThrottleCheckResult WillStartRequest();
29
30 // Called when a server redirect is received by the navigation.
31 virtual ThrottleCheckResult WillRedirectRequest();
32
33 // The NavigationHandle that is tracking the information related to this
34 // navigation.
35 NavigationHandle* navigation_handle() const { return navigation_handle_; }
36
37 private:
38 NavigationHandle* navigation_handle_;
39 };
40
41 } // namespace content
42
43 #endif // CONTENT_PUBLIC_BROWSER_NAVIGATION_THROTTLE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698