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

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

Issue 2411693003: Move blocking of top-level navigations to nested URLs with extension origins from non-extension pro… (Closed)
Patch Set: review comments Created 4 years, 2 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
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 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_NAVIGATION_HANDLE_H_ 5 #ifndef CONTENT_PUBLIC_BROWSER_NAVIGATION_HANDLE_H_
6 #define CONTENT_PUBLIC_BROWSER_NAVIGATION_HANDLE_H_ 6 #define CONTENT_PUBLIC_BROWSER_NAVIGATION_HANDLE_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "content/common/content_export.h" 10 #include "content/common/content_export.h"
11 #include "content/public/browser/navigation_throttle.h" 11 #include "content/public/browser/navigation_throttle.h"
12 #include "content/public/common/referrer.h" 12 #include "content/public/common/referrer.h"
13 #include "net/base/net_errors.h" 13 #include "net/base/net_errors.h"
14 #include "ui/base/page_transition_types.h" 14 #include "ui/base/page_transition_types.h"
15 15
16 class GURL; 16 class GURL;
17 17
18 namespace net { 18 namespace net {
19 class HttpResponseHeaders; 19 class HttpResponseHeaders;
20 } // namespace net 20 } // namespace net
21 21
22 namespace content { 22 namespace content {
23 class NavigationData; 23 class NavigationData;
24 class NavigationThrottle; 24 class NavigationThrottle;
25 class RenderFrameHost; 25 class RenderFrameHost;
26 class SiteInstance;
26 class WebContents; 27 class WebContents;
27 28
28 // A NavigationHandle tracks information related to a single navigation. 29 // A NavigationHandle tracks information related to a single navigation.
29 // NavigationHandles are provided to several WebContentsObserver methods to 30 // NavigationHandles are provided to several WebContentsObserver methods to
30 // allow observers to track specific navigations. Observers should clear any 31 // allow observers to track specific navigations. Observers should clear any
31 // references to a NavigationHandle at the time of 32 // references to a NavigationHandle at the time of
32 // WebContentsObserver::DidFinishNavigation, just before the handle is 33 // WebContentsObserver::DidFinishNavigation, just before the handle is
33 // destroyed. 34 // destroyed.
34 class CONTENT_EXPORT NavigationHandle { 35 class CONTENT_EXPORT NavigationHandle {
35 public: 36 public:
36 virtual ~NavigationHandle() {} 37 virtual ~NavigationHandle() {}
37 38
38 // Parameters available at navigation start time ----------------------------- 39 // Parameters available at navigation start time -----------------------------
39 // 40 //
40 // These parameters are always available during the navigation. Note that 41 // These parameters are always available during the navigation. Note that
41 // some may change during navigation (e.g. due to server redirects). 42 // some may change during navigation (e.g. due to server redirects).
42 43
43 // The URL the frame is navigating to. This may change during the navigation 44 // The URL the frame is navigating to. This may change during the navigation
44 // when encountering a server redirect. 45 // when encountering a server redirect.
45 // This URL may not be the same as the virtual URL returned from 46 // This URL may not be the same as the virtual URL returned from
46 // WebContents::GetVisibleURL and WebContents::GetLastCommittedURL. For 47 // WebContents::GetVisibleURL and WebContents::GetLastCommittedURL. For
47 // example, viewing a page's source navigates to the URL of the page, but the 48 // example, viewing a page's source navigates to the URL of the page, but the
48 // virtual URL is prefixed with "view-source:". 49 // virtual URL is prefixed with "view-source:".
49 virtual const GURL& GetURL() = 0; 50 virtual const GURL& GetURL() = 0;
50 51
52 // Returns the SiteInstance that started the request.
53 // If a frame in SiteInstance A navigates a frame in SiteInstance B to a URL
54 // in SiteInstance C, then this returns B.
55 virtual SiteInstance* GetStartingSiteInstance() = 0;
56
51 // Whether the navigation is taking place in the main frame or in a subframe. 57 // Whether the navigation is taking place in the main frame or in a subframe.
52 // This remains constant over the navigation lifetime. 58 // This remains constant over the navigation lifetime.
53 virtual bool IsInMainFrame() = 0; 59 virtual bool IsInMainFrame() = 0;
54 60
55 // Whether the navigation is taking place in a frame that is a direct child 61 // Whether the navigation is taking place in a frame that is a direct child
56 // of the main frame. This remains constant over the navigation lifetime. 62 // of the main frame. This remains constant over the navigation lifetime.
57 virtual bool IsParentMainFrame() = 0; 63 virtual bool IsParentMainFrame() = 0;
58 64
59 // Whether the navigation was initated by the renderer process. Examples of 65 // Whether the navigation was initated by the renderer process. Examples of
60 // renderer-initiated navigations include: 66 // renderer-initiated navigations include:
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 227
222 // The NavigationData that the embedder returned from 228 // The NavigationData that the embedder returned from
223 // ResourceDispatcherHostDelegate::GetNavigationData during commit. This will 229 // ResourceDispatcherHostDelegate::GetNavigationData during commit. This will
224 // be a clone of the NavigationData. 230 // be a clone of the NavigationData.
225 virtual NavigationData* GetNavigationData() = 0; 231 virtual NavigationData* GetNavigationData() = 0;
226 }; 232 };
227 233
228 } // namespace content 234 } // namespace content
229 235
230 #endif // CONTENT_PUBLIC_BROWSER_NAVIGATION_HANDLE_H_ 236 #endif // CONTENT_PUBLIC_BROWSER_NAVIGATION_HANDLE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698