| 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 "content/common/content_export.h" | 9 #include "content/common/content_export.h" |
| 10 | 10 |
| 11 class GURL; |
| 12 |
| 11 namespace content { | 13 namespace content { |
| 12 | 14 |
| 13 class NavigationControllerImpl; | 15 class NavigationControllerImpl; |
| 14 class NavigatorDelegate; | 16 class NavigatorDelegate; |
| 17 class RenderFrameHostImpl; |
| 15 | 18 |
| 16 // This class is responsible for performing navigations in a node of the | 19 // This class is responsible for performing navigations in a node of the |
| 17 // FrameTree. Its lifetime is bound to all FrameTreeNode objects that are | 20 // FrameTree. Its lifetime is bound to all FrameTreeNode objects that are |
| 18 // using it and will be released once all nodes that use it are freed. | 21 // using it and will be released once all nodes that use it are freed. |
| 19 // The Navigator is bound to a single frame tree and cannot be used by multiple | 22 // The Navigator is bound to a single frame tree and cannot be used by multiple |
| 20 // instances of FrameTree. | 23 // instances of FrameTree. |
| 21 // TODO(nasko): Move all navigation methods, such as didStartProvisionalLoad | 24 // TODO(nasko): Move all navigation methods, such as didStartProvisionalLoad |
| 22 // from WebContentsImpl to this class. | 25 // from WebContentsImpl to this class. |
| 23 class CONTENT_EXPORT Navigator : public base::RefCounted<Navigator> { | 26 class CONTENT_EXPORT Navigator : public base::RefCounted<Navigator> { |
| 24 public: | 27 public: |
| 25 Navigator(NavigationControllerImpl* nav_controller, | 28 Navigator(NavigationControllerImpl* nav_controller, |
| 26 NavigatorDelegate* delegate); | 29 NavigatorDelegate* delegate); |
| 27 | 30 |
| 28 NavigationControllerImpl* controller() { | 31 NavigationControllerImpl* controller() { |
| 29 return controller_; | 32 return controller_; |
| 30 } | 33 } |
| 31 | 34 |
| 32 NavigatorDelegate* delegate() { | 35 NavigatorDelegate* delegate() { |
| 33 return delegate_; | 36 return delegate_; |
| 34 } | 37 } |
| 35 | 38 |
| 39 // The RenderFrameHostImpl started a provisional load. |
| 40 void DidStartProvisionalLoad(RenderFrameHostImpl* render_frame_host, |
| 41 int64 frame_id, |
| 42 int64 parent_frame_id, |
| 43 bool main_frame, |
| 44 const GURL& url); |
| 45 |
| 36 private: | 46 private: |
| 37 friend class base::RefCounted<Navigator>; | 47 friend class base::RefCounted<Navigator>; |
| 38 virtual ~Navigator() {} | 48 virtual ~Navigator() {} |
| 39 | 49 |
| 40 // The NavigationController that will keep track of session history for all | 50 // The NavigationController that will keep track of session history for all |
| 41 // RenderFrameHost objects using this Navigator. | 51 // RenderFrameHost objects using this Navigator. |
| 42 // TODO(nasko): Move ownership of the NavigationController from | 52 // TODO(nasko): Move ownership of the NavigationController from |
| 43 // WebContentsImpl to this class. | 53 // WebContentsImpl to this class. |
| 44 NavigationControllerImpl* controller_; | 54 NavigationControllerImpl* controller_; |
| 45 | 55 |
| 46 // Used to notify the object embedding this Navigator about navigation | 56 // Used to notify the object embedding this Navigator about navigation |
| 47 // events. Can be NULL in tests. | 57 // events. Can be NULL in tests. |
| 48 NavigatorDelegate* delegate_; | 58 NavigatorDelegate* delegate_; |
| 49 }; | 59 }; |
| 50 | 60 |
| 51 } // namespace content | 61 } // namespace content |
| 52 | 62 |
| 53 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATOR_H_ | 63 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATOR_H_ |
| OLD | NEW |