OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2016 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_BROWSER_DEVTOOLS_PAGE_NAVIGATION_THROTTLE_H_ | |
6 #define CONTENT_BROWSER_DEVTOOLS_PAGE_NAVIGATION_THROTTLE_H_ | |
7 | |
8 #include "base/macros.h" | |
9 #include "base/memory/weak_ptr.h" | |
10 #include "content/public/browser/navigation_throttle.h" | |
11 | |
12 namespace content { | |
13 namespace devtools { | |
14 namespace page { | |
15 class PageHandler; | |
16 } // namespace page | |
17 | |
18 class PageNavigationThrottle : public content::NavigationThrottle { | |
nasko
2016/07/12 18:03:11
Can you put a class level comment? What is this cl
alex clarke (OOO till 29th)
2016/07/12 20:36:14
Done.
| |
19 public: | |
20 PageNavigationThrottle(base::WeakPtr<page::PageHandler> page_handler, | |
21 int navigation_id, | |
22 content::NavigationHandle* navigation_handle); | |
23 ~PageNavigationThrottle() override; | |
24 | |
25 // content::NavigationThrottle implementation: | |
26 NavigationThrottle::ThrottleCheckResult WillStartRequest() override; | |
27 NavigationThrottle::ThrottleCheckResult WillRedirectRequest() override; | |
28 NavigationThrottle::ThrottleCheckResult WillProcessResponse() override; | |
29 | |
30 int navigation_id() const { return navigation_id_; } | |
31 | |
32 // Tells the PageNavigationThrottle to not throttle anything! | |
33 void AlwaysProceed(); | |
34 | |
35 // Resumes a deferred navigation request. Does nothing if a response isn't | |
36 // expected. | |
37 void Resume(); | |
38 | |
39 // Cancels a deferred navigation request. Does nothing if a response isn't | |
40 // expected. | |
41 void CancelDeferredNavigation(NavigationThrottle::ThrottleCheckResult result); | |
42 | |
43 private: | |
44 int navigation_id_; | |
45 base::WeakPtr<page::PageHandler> page_handler_; | |
46 bool response_pending_; | |
47 | |
48 DISALLOW_COPY_AND_ASSIGN(PageNavigationThrottle); | |
49 }; | |
50 | |
51 } // namespace devtools | |
52 } // namespace content | |
53 | |
54 #endif // CONTENT_BROWSER_DEVTOOLS_PAGE_NAVIGATION_THROTTLE_H_ | |
OLD | NEW |