Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 created the request. | |
|
alexmos
2016/10/12 23:13:28
To eliminate any possible confusion with the initi
jam
2016/10/13 00:14:46
Done.
| |
| 53 virtual SiteInstance* GetCreatorSiteInstance() = 0; | |
|
alexmos
2016/10/12 23:13:28
We had some more discussions about the name, and w
jam
2016/10/13 00:14:46
Done.
| |
| 54 | |
| 51 // Whether the navigation is taking place in the main frame or in a subframe. | 55 // Whether the navigation is taking place in the main frame or in a subframe. |
| 52 // This remains constant over the navigation lifetime. | 56 // This remains constant over the navigation lifetime. |
| 53 virtual bool IsInMainFrame() = 0; | 57 virtual bool IsInMainFrame() = 0; |
| 54 | 58 |
| 55 // Whether the navigation is taking place in a frame that is a direct child | 59 // 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. | 60 // of the main frame. This remains constant over the navigation lifetime. |
| 57 virtual bool IsParentMainFrame() = 0; | 61 virtual bool IsParentMainFrame() = 0; |
| 58 | 62 |
| 59 // Whether the navigation was initated by the renderer process. Examples of | 63 // Whether the navigation was initated by the renderer process. Examples of |
| 60 // renderer-initiated navigations include: | 64 // renderer-initiated navigations include: |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 221 | 225 |
| 222 // The NavigationData that the embedder returned from | 226 // The NavigationData that the embedder returned from |
| 223 // ResourceDispatcherHostDelegate::GetNavigationData during commit. This will | 227 // ResourceDispatcherHostDelegate::GetNavigationData during commit. This will |
| 224 // be a clone of the NavigationData. | 228 // be a clone of the NavigationData. |
| 225 virtual NavigationData* GetNavigationData() = 0; | 229 virtual NavigationData* GetNavigationData() = 0; |
| 226 }; | 230 }; |
| 227 | 231 |
| 228 } // namespace content | 232 } // namespace content |
| 229 | 233 |
| 230 #endif // CONTENT_PUBLIC_BROWSER_NAVIGATION_HANDLE_H_ | 234 #endif // CONTENT_PUBLIC_BROWSER_NAVIGATION_HANDLE_H_ |
| OLD | NEW |