OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_BROWSER_FRAME_HOST_INTERSTITIAL_PAGE_NAVIGATOR_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_FRAME_HOST_INTERSTITIAL_PAGE_NAVIGATOR_IMPL_H_ |
6 #define CONTENT_BROWSER_FRAME_HOST_INTERSTITIAL_PAGE_NAVIGATOR_IMPL_H_ | 6 #define CONTENT_BROWSER_FRAME_HOST_INTERSTITIAL_PAGE_NAVIGATOR_IMPL_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "content/browser/frame_host/navigation_handle_impl.h" | 10 #include "content/browser/frame_host/navigation_handle_impl.h" |
11 #include "content/browser/frame_host/navigator.h" | 11 #include "content/browser/frame_host/navigator.h" |
12 #include "content/common/content_export.h" | 12 #include "content/common/content_export.h" |
13 | 13 |
14 namespace content { | 14 namespace content { |
15 | 15 |
16 class NavigationControllerImpl; | 16 class NavigationControllerImpl; |
17 class InterstitialPageImpl; | 17 class InterstitialPageImpl; |
18 | 18 |
19 // Navigator implementation specific to InterstialPageImpl. It allows only one | 19 // Navigator implementation specific to InterstialPageImpl. It allows only one |
20 // navigation to commit, since interstitial pages are not allowed to navigate. | 20 // navigation to commit, since interstitial pages are not allowed to navigate. |
21 class CONTENT_EXPORT InterstitialPageNavigatorImpl : public Navigator { | 21 class CONTENT_EXPORT InterstitialPageNavigatorImpl : public Navigator { |
22 public: | 22 public: |
23 InterstitialPageNavigatorImpl( | 23 InterstitialPageNavigatorImpl( |
24 InterstitialPageImpl* interstitial, | 24 InterstitialPageImpl* interstitial, |
25 NavigationControllerImpl* navigation_controller); | 25 NavigationControllerImpl* navigation_controller); |
26 | 26 |
| 27 // Navigator implementation. |
27 NavigatorDelegate* GetDelegate() override; | 28 NavigatorDelegate* GetDelegate() override; |
28 NavigationController* GetController() override; | 29 NavigationController* GetController() override; |
29 void DidStartProvisionalLoad( | 30 void DidStartProvisionalLoad( |
30 RenderFrameHostImpl* render_frame_host, | 31 RenderFrameHostImpl* render_frame_host, |
31 const GURL& url, | 32 const GURL& url, |
32 const std::vector<GURL>& redirect_chain, | 33 const std::vector<GURL>& redirect_chain, |
33 const base::TimeTicks& navigation_start) override; | 34 const base::TimeTicks& navigation_start) override; |
34 void DidNavigate( | 35 void DidNavigate( |
35 RenderFrameHostImpl* render_frame_host, | 36 RenderFrameHostImpl* render_frame_host, |
36 const FrameHostMsg_DidCommitProvisionalLoad_Params& input_params, | 37 const FrameHostMsg_DidCommitProvisionalLoad_Params& input_params, |
37 std::unique_ptr<NavigationHandleImpl> navigation_handle) override; | 38 std::unique_ptr<NavigationHandleImpl> navigation_handle) override; |
38 | 39 |
| 40 // Disables any further action when the interstitial page is preparing to |
| 41 // delete itself. |
| 42 void Disable(); |
| 43 |
39 private: | 44 private: |
40 ~InterstitialPageNavigatorImpl() override; | 45 ~InterstitialPageNavigatorImpl() override; |
41 | 46 |
42 // The InterstitialPage with which this navigator object is associated. | 47 // The InterstitialPage with which this navigator object is associated. |
43 // Non owned pointer. | 48 // Non owned pointer. |
44 InterstitialPageImpl* interstitial_; | 49 InterstitialPageImpl* interstitial_; |
45 | 50 |
46 // The NavigationController associated with this navigator. | 51 // The NavigationController associated with this navigator. |
47 NavigationControllerImpl* controller_; | 52 NavigationControllerImpl* controller_; |
48 | 53 |
| 54 // Whether this interstitial is still enabled. Becomes false when the |
| 55 // interstitial page is asychronously deleting itself. |
| 56 bool enabled_; |
| 57 |
49 DISALLOW_COPY_AND_ASSIGN(InterstitialPageNavigatorImpl); | 58 DISALLOW_COPY_AND_ASSIGN(InterstitialPageNavigatorImpl); |
50 }; | 59 }; |
51 | 60 |
52 } // namespace content | 61 } // namespace content |
53 | 62 |
54 #endif // CONTENT_BROWSER_FRAME_HOST_INTERSTITIAL_PAGE_NAVIGATOR_IMPL_H_ | 63 #endif // CONTENT_BROWSER_FRAME_HOST_INTERSTITIAL_PAGE_NAVIGATOR_IMPL_H_ |
OLD | NEW |