| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_NAVIGATOR_H_ | 5 #ifndef CONTENT_BROWSER_FRAME_HOST_NAVIGATOR_H_ |
| 6 #define CONTENT_BROWSER_FRAME_HOST_NAVIGATOR_H_ | 6 #define CONTENT_BROWSER_FRAME_HOST_NAVIGATOR_H_ |
| 7 | 7 |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
| 10 #include "content/browser/frame_host/navigator_delegate.h" | 10 #include "content/browser/frame_host/navigator_delegate.h" |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 const FrameHostMsg_DidFailProvisionalLoadWithError_Params& params) {}; | 65 const FrameHostMsg_DidFailProvisionalLoadWithError_Params& params) {}; |
| 66 | 66 |
| 67 // The RenderFrameHostImpl has failed to load the document. | 67 // The RenderFrameHostImpl has failed to load the document. |
| 68 virtual void DidFailLoadWithError( | 68 virtual void DidFailLoadWithError( |
| 69 RenderFrameHostImpl* render_frame_host, | 69 RenderFrameHostImpl* render_frame_host, |
| 70 const GURL& url, | 70 const GURL& url, |
| 71 int error_code, | 71 int error_code, |
| 72 const base::string16& error_description, | 72 const base::string16& error_description, |
| 73 bool was_ignored_by_handler) {} | 73 bool was_ignored_by_handler) {} |
| 74 | 74 |
| 75 // The RenderFrameHostImpl has committed a navigation. | 75 // The RenderFrameHostImpl has committed a navigation. The Navigator is |
| 76 // responsible for resetting |navigation_handle| at the end of this method and |
| 77 // should not attempt to keep it alive. |
| 78 // Note: it is possible that |navigation_handle| is not the NavigationHandle |
| 79 // stored in the RenderFrameHost that just committed. This happens for example |
| 80 // when a same-page navigation commits while another navigation is ongoing. |
| 81 // The Navigator should use the NavigationHandle provided by this method and |
| 82 // not attempt to access the RenderFrameHost's NavigationsHandle. |
| 76 virtual void DidNavigate( | 83 virtual void DidNavigate( |
| 77 RenderFrameHostImpl* render_frame_host, | 84 RenderFrameHostImpl* render_frame_host, |
| 78 const FrameHostMsg_DidCommitProvisionalLoad_Params& params) {} | 85 const FrameHostMsg_DidCommitProvisionalLoad_Params& params, |
| 86 std::unique_ptr<NavigationHandleImpl> navigation_handle) {} |
| 79 | 87 |
| 80 // Called by the NavigationController to cause the Navigator to navigate | 88 // Called by the NavigationController to cause the Navigator to navigate |
| 81 // to the current pending entry. The NavigationController should be called | 89 // to the current pending entry. The NavigationController should be called |
| 82 // back with RendererDidNavigate on success or DiscardPendingEntry on failure. | 90 // back with RendererDidNavigate on success or DiscardPendingEntry on failure. |
| 83 // The callbacks can be inside of this function, or at some future time. | 91 // The callbacks can be inside of this function, or at some future time. |
| 84 // | 92 // |
| 85 // If this method returns false, then the navigation is discarded (equivalent | 93 // If this method returns false, then the navigation is discarded (equivalent |
| 86 // to calling DiscardPendingEntry on the NavigationController). | 94 // to calling DiscardPendingEntry on the NavigationController). |
| 87 // | 95 // |
| 88 // TODO(nasko): Remove this method from the interface, since Navigator and | 96 // TODO(nasko): Remove this method from the interface, since Navigator and |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 virtual void DiscardPendingEntryIfNeeded(NavigationHandleImpl* handle) {} | 203 virtual void DiscardPendingEntryIfNeeded(NavigationHandleImpl* handle) {} |
| 196 | 204 |
| 197 protected: | 205 protected: |
| 198 friend class base::RefCounted<Navigator>; | 206 friend class base::RefCounted<Navigator>; |
| 199 virtual ~Navigator() {} | 207 virtual ~Navigator() {} |
| 200 }; | 208 }; |
| 201 | 209 |
| 202 } // namespace content | 210 } // namespace content |
| 203 | 211 |
| 204 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATOR_H_ | 212 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATOR_H_ |
| OLD | NEW |