OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_INTERSTITIAL_PAGE_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_INTERSTITIAL_PAGE_H_ |
6 #define CONTENT_PUBLIC_BROWSER_INTERSTITIAL_PAGE_H_ | 6 #define CONTENT_PUBLIC_BROWSER_INTERSTITIAL_PAGE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "content/common/content_export.h" | 9 #include "content/common/content_export.h" |
10 | 10 |
(...skipping 16 matching lines...) Expand all Loading... |
27 // | 27 // |
28 // If specified in the Create function, this class creates a navigation entry so | 28 // If specified in the Create function, this class creates a navigation entry so |
29 // that when the interstitial shows, the current entry is the target URL. | 29 // that when the interstitial shows, the current entry is the target URL. |
30 // | 30 // |
31 // InterstitialPage instances take care of deleting themselves when closed | 31 // InterstitialPage instances take care of deleting themselves when closed |
32 // through a navigation, the WebContents closing them or the tab containing them | 32 // through a navigation, the WebContents closing them or the tab containing them |
33 // being closed. | 33 // being closed. |
34 | 34 |
35 class InterstitialPage { | 35 class InterstitialPage { |
36 public: | 36 public: |
37 // Creates an interstitial page to show in |tab|. |new_navigation| should be | 37 // Creates an interstitial page to show in |web_contents|. |new_navigation| |
38 // set to true when the interstitial is caused by loading a new page, in which | 38 // should be set to true when the interstitial is caused by loading a new |
39 // case a temporary navigation entry is created with the URL |url| and added | 39 // page, in which case a temporary navigation entry is created with the URL |
40 // to the navigation controller (so the interstitial page appears as a new | 40 // |url| and added to the navigation controller (so the interstitial page |
41 // navigation entry). |new_navigation| should be false when the interstitial | 41 // appears as a new navigation entry). |new_navigation| should be false when |
42 // was triggered by a loading a sub-resource in a page. Takes ownership of | 42 // the interstitial was triggered by a loading a sub-resource in a page. Takes |
43 // |delegate|. | 43 // ownership of |delegate|. |
44 CONTENT_EXPORT static InterstitialPage* Create( | 44 CONTENT_EXPORT static InterstitialPage* Create( |
45 WebContents* tab, | 45 WebContents* web_contents, |
46 bool new_navigation, | 46 bool new_navigation, |
47 const GURL& url, | 47 const GURL& url, |
48 InterstitialPageDelegate* delegate); | 48 InterstitialPageDelegate* delegate); |
49 | 49 |
50 // Retrieves the InterstitialPage if any associated with the specified | 50 // Retrieves the InterstitialPage if any associated with the specified |
51 // |web_contents| (used by ui tests). | 51 // |web_contents| (used by ui tests). |
52 CONTENT_EXPORT static InterstitialPage* GetInterstitialPage( | 52 CONTENT_EXPORT static InterstitialPage* GetInterstitialPage( |
53 WebContents* web_contents); | 53 WebContents* web_contents); |
54 | 54 |
55 virtual ~InterstitialPage() {} | 55 virtual ~InterstitialPage() {} |
(...skipping 23 matching lines...) Expand all Loading... |
79 virtual void Focus() = 0; | 79 virtual void Focus() = 0; |
80 | 80 |
81 virtual RenderViewHost* GetRenderViewHostForTesting() const = 0; | 81 virtual RenderViewHost* GetRenderViewHostForTesting() const = 0; |
82 virtual InterstitialPageDelegate* GetDelegateForTesting() = 0; | 82 virtual InterstitialPageDelegate* GetDelegateForTesting() = 0; |
83 virtual void DontCreateViewForTesting() = 0; | 83 virtual void DontCreateViewForTesting() = 0; |
84 }; | 84 }; |
85 | 85 |
86 } // namespace content | 86 } // namespace content |
87 | 87 |
88 #endif // CONTENT_PUBLIC_BROWSER_INTERSTITIAL_PAGE_H_ | 88 #endif // CONTENT_PUBLIC_BROWSER_INTERSTITIAL_PAGE_H_ |
OLD | NEW |