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

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

Issue 1667163002: Add methods to NavigationHandle to allow refactoring webNavigation to use it. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixes based on Camille's review. 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
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 "content/common/content_export.h" 8 #include "content/common/content_export.h"
9 #include "content/public/browser/navigation_throttle.h" 9 #include "content/public/browser/navigation_throttle.h"
10 #include "content/public/common/referrer.h" 10 #include "content/public/common/referrer.h"
(...skipping 23 matching lines...) Expand all
34 // some may change during navigation (e.g. due to server redirects). 34 // some may change during navigation (e.g. due to server redirects).
35 35
36 // The URL the frame is navigating to. This may change during the navigation 36 // The URL the frame is navigating to. This may change during the navigation
37 // when encountering a server redirect. 37 // when encountering a server redirect.
38 virtual const GURL& GetURL() = 0; 38 virtual const GURL& GetURL() = 0;
39 39
40 // Whether the navigation is taking place in the main frame or in a subframe. 40 // Whether the navigation is taking place in the main frame or in a subframe.
41 // This remains constant over the navigation lifetime. 41 // This remains constant over the navigation lifetime.
42 virtual bool IsInMainFrame() = 0; 42 virtual bool IsInMainFrame() = 0;
43 43
44 // Whether the navigation is taking place in a frame that is a direct child
45 // of the main frame. This remains constant over the navigation lifetime.
46 virtual bool IsParentMainFrame() = 0;
47
48 // Whether the navigation is synchronous or not. Examples of synchronous
49 // navigations are:
50 // * reference fragment navigations
51 // * pushState/popState
52 virtual bool IsSynchronousNavigation() = 0;
53
54 // Whether the navigation is for an iframe with srcdoc attribute.
55 virtual bool IsSrcdoc() = 0;
56
57 // Returns the FrameTreeNode ID for the frame in which the navigation is
58 // performed. This ID is browser-global and uniquely identifies a frame that
59 // hosts content. The identifier is fixed at the creation of the frame and
60 // stays constant for the lifetime of the frame.
61 virtual int GetFrameTreeNodeId() = 0;
62
63 // Returns the FrameTreeNode ID for the parent frame. If this navigation is
64 // taking place in the main frame, the value returned is -1.
65 virtual int GetParentFrameTreeNodeId() = 0;
66
44 // The WebContents the navigation is taking place in. 67 // The WebContents the navigation is taking place in.
45 WebContents* GetWebContents(); 68 WebContents* GetWebContents();
46 69
47 // The time the navigation started, recorded either in the renderer or in the 70 // The time the navigation started, recorded either in the renderer or in the
48 // browser process. Corresponds to Navigation Timing API. 71 // browser process. Corresponds to Navigation Timing API.
49 virtual const base::TimeTicks& NavigationStart() = 0; 72 virtual const base::TimeTicks& NavigationStart() = 0;
50 73
51 // Parameters available at network request start time ------------------------ 74 // Parameters available at network request start time ------------------------
52 // 75 //
53 // The following parameters are only available when the network request is 76 // The following parameters are only available when the network request is
(...skipping 29 matching lines...) Expand all
83 106
84 // Returns the RenderFrameHost this navigation is taking place in. This can 107 // Returns the RenderFrameHost this navigation is taking place in. This can
85 // only be accessed after the navigation is ready to commit. 108 // only be accessed after the navigation is ready to commit.
86 virtual RenderFrameHost* GetRenderFrameHost() = 0; 109 virtual RenderFrameHost* GetRenderFrameHost() = 0;
87 110
88 // Whether the navigation happened in the same page. This is only known 111 // Whether the navigation happened in the same page. This is only known
89 // after the navigation has committed. It is an error to call this method 112 // after the navigation has committed. It is an error to call this method
90 // before the navigation has committed. 113 // before the navigation has committed.
91 virtual bool IsSamePage() = 0; 114 virtual bool IsSamePage() = 0;
92 115
116 // Whether the navigation has encountered a server redirect or not.
117 virtual bool WasServerRedirect() = 0;
118
93 // Whether the navigation has committed. This returns true for either 119 // Whether the navigation has committed. This returns true for either
94 // successful commits or error pages that replace the previous page 120 // successful commits or error pages that replace the previous page
95 // (distinguished by |IsErrorPage|), and false for errors that leave the user 121 // (distinguished by |IsErrorPage|), and false for errors that leave the user
96 // on the previous page. 122 // on the previous page.
97 virtual bool HasCommitted() = 0; 123 virtual bool HasCommitted() = 0;
98 124
99 // Whether the navigation resulted in an error page. 125 // Whether the navigation resulted in an error page.
100 virtual bool IsErrorPage() = 0; 126 virtual bool IsErrorPage() = 0;
101 127
102 // Resumes a navigation that was previously deferred by a NavigationThrottle. 128 // Resumes a navigation that was previously deferred by a NavigationThrottle.
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 virtual NavigationThrottle::ThrottleCheckResult 164 virtual NavigationThrottle::ThrottleCheckResult
139 CallWillRedirectRequestForTesting(const GURL& new_url, 165 CallWillRedirectRequestForTesting(const GURL& new_url,
140 bool new_method_is_post, 166 bool new_method_is_post,
141 const GURL& new_referrer_url, 167 const GURL& new_referrer_url,
142 bool new_is_external_protocol) = 0; 168 bool new_is_external_protocol) = 0;
143 }; 169 };
144 170
145 } // namespace content 171 } // namespace content
146 172
147 #endif // CONTENT_PUBLIC_BROWSER_NAVIGATION_HANDLE_H_ 173 #endif // CONTENT_PUBLIC_BROWSER_NAVIGATION_HANDLE_H_
OLDNEW
« no previous file with comments | « content/browser/frame_host/render_frame_host_impl.cc ('k') | content/public/browser/navigation_handle.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698