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

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

Issue 1629013002: Allow a main interstitial frame to act as an ExtensionMessagePort opener (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@extension-message-port-onDisconnect-580882
Patch Set: Remove trailing space Created 4 years, 10 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
« no previous file with comments | « content/browser/frame_host/render_frame_host_delegate.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 7
8 #include "content/common/content_export.h" 8 #include "content/common/content_export.h"
9 9
10 class GURL; 10 class GURL;
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 WebContents* web_contents, 46 WebContents* web_contents,
47 bool new_navigation, 47 bool new_navigation,
48 const GURL& url, 48 const GURL& url,
49 InterstitialPageDelegate* delegate); 49 InterstitialPageDelegate* delegate);
50 50
51 // Retrieves the InterstitialPage if any associated with the specified 51 // Retrieves the InterstitialPage if any associated with the specified
52 // |web_contents|. 52 // |web_contents|.
53 CONTENT_EXPORT static InterstitialPage* GetInterstitialPage( 53 CONTENT_EXPORT static InterstitialPage* GetInterstitialPage(
54 WebContents* web_contents); 54 WebContents* web_contents);
55 55
56 // Retrieves the InterstitialPage that hosts the RenderFrameHost, or nullptr
57 // if |rfh| is not a part of any InterstitialPage.
58 CONTENT_EXPORT static InterstitialPage* FromRenderFrameHost(
59 RenderFrameHost* rfh);
60
56 virtual ~InterstitialPage() {} 61 virtual ~InterstitialPage() {}
57 62
58 // Shows the interstitial page in the tab. 63 // Shows the interstitial page in the tab.
59 virtual void Show() = 0; 64 virtual void Show() = 0;
60 65
61 // Hides the interstitial page. 66 // Hides the interstitial page.
62 virtual void Hide() = 0; 67 virtual void Hide() = 0;
63 68
64 // Reverts to the page showing before the interstitial. 69 // Reverts to the page showing before the interstitial.
65 // Delegates should call this method when the user has chosen NOT to proceed 70 // Delegates should call this method when the user has chosen NOT to proceed
66 // to the target URL. 71 // to the target URL.
67 // Warning: if |new_navigation| was set to true in the constructor, 'this' 72 // Warning: if |new_navigation| was set to true in the constructor, 'this'
68 // will be deleted when this method returns. 73 // will be deleted when this method returns.
69 virtual void DontProceed() = 0; 74 virtual void DontProceed() = 0;
70 75
71 // Delegates should call this method when the user has chosen to proceed to 76 // Delegates should call this method when the user has chosen to proceed to
72 // the target URL. 77 // the target URL.
73 // Warning: 'this' has been deleted when this method returns. 78 // Warning: 'this' has been deleted when this method returns.
74 virtual void Proceed() = 0; 79 virtual void Proceed() = 0;
75 80
76 // Sizes the RenderViewHost showing the actual interstitial page contents. 81 // Sizes the RenderViewHost showing the actual interstitial page contents.
77 virtual void SetSize(const gfx::Size& size) = 0; 82 virtual void SetSize(const gfx::Size& size) = 0;
78 83
79 // Sets the focus to the interstitial. 84 // Sets the focus to the interstitial.
80 virtual void Focus() = 0; 85 virtual void Focus() = 0;
81 86
87 // Get the WebContents in which this interstitial is shown. Warning: Frames
88 // in the intersitital are NOT visible through WebContentObservers' normal
89 // notifications (e.g. RenderFrameDeleted). The only sensible use of this
90 // returned WebContents is to add a WebContentObserver and listen for the
91 // DidAttachInterstitialPage or DidDetachInterstitialPage notifications.
92 virtual WebContents* GetWebContents() const = 0;
93
82 // Gets the RenderFrameHost associated with 94 // Gets the RenderFrameHost associated with
83 // the interstitial page's main frame. 95 // the interstitial page's main frame.
84 virtual RenderFrameHost* GetMainFrame() const = 0; 96 virtual RenderFrameHost* GetMainFrame() const = 0;
85 97
86 virtual InterstitialPageDelegate* GetDelegateForTesting() = 0; 98 virtual InterstitialPageDelegate* GetDelegateForTesting() = 0;
87 virtual void DontCreateViewForTesting() = 0; 99 virtual void DontCreateViewForTesting() = 0;
88 }; 100 };
89 101
90 } // namespace content 102 } // namespace content
91 103
92 #endif // CONTENT_PUBLIC_BROWSER_INTERSTITIAL_PAGE_H_ 104 #endif // CONTENT_PUBLIC_BROWSER_INTERSTITIAL_PAGE_H_
OLDNEW
« no previous file with comments | « content/browser/frame_host/render_frame_host_delegate.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698