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_BROWSER_FRAME_HOST_NAVIGATION_HANDLE_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_FRAME_HOST_NAVIGATION_HANDLE_IMPL_H_ |
6 #define CONTENT_BROWSER_FRAME_HOST_NAVIGATION_HANDLE_IMPL_H_ | 6 #define CONTENT_BROWSER_FRAME_HOST_NAVIGATION_HANDLE_IMPL_H_ |
7 | 7 |
8 #include "content/public/browser/navigation_handle.h" | 8 #include "content/public/browser/navigation_handle.h" |
9 | 9 |
10 #include <stddef.h> | 10 #include <stddef.h> |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 NavigationData* GetNavigationData() override; | 170 NavigationData* GetNavigationData() override; |
171 | 171 |
172 // Used in tests. | 172 // Used in tests. |
173 State state_for_testing() const { return state_; } | 173 State state_for_testing() const { return state_; } |
174 | 174 |
175 // Whether or not the navigation has been initiated by a form submission. | 175 // Whether or not the navigation has been initiated by a form submission. |
176 // TODO(arthursonzogni): This value is correct only when PlzNavigate is | 176 // TODO(arthursonzogni): This value is correct only when PlzNavigate is |
177 // enabled. Make it work in both modes. | 177 // enabled. Make it work in both modes. |
178 bool is_form_submission() const { return is_form_submission_; } | 178 bool is_form_submission() const { return is_form_submission_; } |
179 | 179 |
| 180 // Whether the navigation request is a download. This is useful when the |
| 181 // navigation hasn't committed yet, in which case HasCommitted() will return |
| 182 // false even if the navigation request is not a download. |
| 183 bool is_download() const { return is_download_; } |
| 184 |
180 // The NavigatorDelegate to notify/query for various navigation events. | 185 // The NavigatorDelegate to notify/query for various navigation events. |
181 // Normally this is the WebContents, except if this NavigationHandle was | 186 // Normally this is the WebContents, except if this NavigationHandle was |
182 // created during a navigation to an interstitial page. In this case it will | 187 // created during a navigation to an interstitial page. In this case it will |
183 // be the InterstitialPage itself. | 188 // be the InterstitialPage itself. |
184 // | 189 // |
185 // Note: due to the interstitial navigation case, all calls that can possibly | 190 // Note: due to the interstitial navigation case, all calls that can possibly |
186 // expose the NavigationHandle to code outside of content/ MUST go though the | 191 // expose the NavigationHandle to code outside of content/ MUST go though the |
187 // NavigatorDelegate. In particular, the ContentBrowserClient should not be | 192 // NavigatorDelegate. In particular, the ContentBrowserClient should not be |
188 // called directly form the NavigationHandle code. Thus, these calls will not | 193 // called directly form the NavigationHandle code. Thus, these calls will not |
189 // expose the NavigationHandle when navigating to an InterstialPage. | 194 // expose the NavigationHandle when navigating to an InterstialPage. |
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
557 SourceLocation source_location_; | 562 SourceLocation source_location_; |
558 | 563 |
559 base::WeakPtrFactory<NavigationHandleImpl> weak_factory_; | 564 base::WeakPtrFactory<NavigationHandleImpl> weak_factory_; |
560 | 565 |
561 DISALLOW_COPY_AND_ASSIGN(NavigationHandleImpl); | 566 DISALLOW_COPY_AND_ASSIGN(NavigationHandleImpl); |
562 }; | 567 }; |
563 | 568 |
564 } // namespace content | 569 } // namespace content |
565 | 570 |
566 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_HANDLE_IMPL_H_ | 571 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_HANDLE_IMPL_H_ |
OLD | NEW |