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

Side by Side Diff: components/navigation_interception/intercept_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: 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 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 COMPONENTS_NAVIGATION_INTERCEPTION_INTERCEPT_NAVIGATION_THROTTLE_H_
6 #define COMPONENTS_NAVIGATION_INTERCEPTION_INTERCEPT_NAVIGATION_THROTTLE_H_
7
8 #include <string>
9
10 #include "base/callback.h"
11 #include "base/memory/weak_ptr.h"
12 #include "content/public/browser/navigation_throttle.h"
13
14 class GURL;
15
16 namespace content {
17 class NavigationHandle;
18 class WebContents;
19 }
20
21 namespace navigation_interception {
22
23 class NavigationParams;
24
25 // This class allows the provider of the Callback to selectively ignore top
26 // level navigations.
27 class InterceptNavigationThrottle : public content::NavigationThrottle {
28 public:
29 typedef base::Callback<bool(content::WebContents* /* source */,
30 const NavigationParams& /* navigation_params */)>
31 CheckCallback;
32
33 InterceptNavigationThrottle(content::WebContents* web_contents,
34 content::NavigationHandle* navigation_handle,
35 CheckCallback should_ignore_callback);
36 ~InterceptNavigationThrottle() override;
37
38 // content::NavigationThrottle implementation:
39 ThrottleCheckResult WillStartRequest() override;
40 ThrottleCheckResult WillRedirectRequest() override;
41
42 private:
43 ThrottleCheckResult CheckIfShouldIgnoreNavigation(bool is_redirect);
44
45 content::WebContents* web_contents_;
46 CheckCallback should_ignore_callback_;
47
48 DISALLOW_COPY_AND_ASSIGN(InterceptNavigationThrottle);
49 };
50
51 } // namespace navigation_interception
52
53 #endif // COMPONENTS_NAVIGATION_INTERCEPTION_INTERCEPT_NAVIGATION_THROTTLE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698