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_DELEGATE_H_ | 5 #ifndef CONTENT_BROWSER_FRAME_HOST_NAVIGATOR_DELEGATE_H_ |
6 #define CONTENT_BROWSER_FRAME_HOST_NAVIGATOR_DELEGATE_H_ | 6 #define CONTENT_BROWSER_FRAME_HOST_NAVIGATOR_DELEGATE_H_ |
7 | 7 |
| 8 #include "base/strings/string16.h" |
8 #include "content/public/browser/invalidate_type.h" | 9 #include "content/public/browser/invalidate_type.h" |
9 #include "content/public/browser/navigation_controller.h" | 10 #include "content/public/browser/navigation_controller.h" |
| 11 #include "content/public/common/page_transition_types.h" |
| 12 |
| 13 class GURL; |
| 14 struct FrameHostMsg_DidCommitProvisionalLoad_Params; |
| 15 struct FrameHostMsg_DidFailProvisionalLoadWithError_Params; |
10 | 16 |
11 namespace content { | 17 namespace content { |
12 | 18 |
13 class RenderFrameHost; | 19 class RenderFrameHostImpl; |
| 20 struct LoadCommittedDetails; |
14 | 21 |
15 // A delegate API used by Navigator to notify its embedder of navigation | 22 // A delegate API used by Navigator to notify its embedder of navigation |
16 // related events. | 23 // related events. |
17 class NavigatorDelegate { | 24 class CONTENT_EXPORT NavigatorDelegate { |
18 public: | 25 public: |
19 // The RenderFrameHost started a provisional load for the frame | 26 // The RenderFrameHost started a provisional load for the frame |
20 // represented by |render_frame_host|. | 27 // represented by |render_frame_host|. |
21 virtual void DidStartProvisionalLoad( | 28 virtual void DidStartProvisionalLoad( |
22 RenderFrameHostImpl* render_frame_host, | 29 RenderFrameHostImpl* render_frame_host, |
23 int64 frame_id, | 30 int64 frame_id, |
24 int64 parent_frame_id, | 31 int64 parent_frame_id, |
25 bool is_main_frame, | 32 bool is_main_frame, |
26 const GURL& validated_url, | 33 const GURL& validated_url, |
27 bool is_error_page, | 34 bool is_error_page, |
28 bool is_iframe_srcdoc) {} | 35 bool is_iframe_srcdoc) {} |
29 | 36 |
30 // A provisional load in |render_frame_host| failed. | 37 // A provisional load in |render_frame_host| failed. |
31 virtual void DidFailProvisionalLoadWithError( | 38 virtual void DidFailProvisionalLoadWithError( |
32 RenderFrameHostImpl* render_frame_host, | 39 RenderFrameHostImpl* render_frame_host, |
33 const FrameHostMsg_DidFailProvisionalLoadWithError_Params& params) {} | 40 const FrameHostMsg_DidFailProvisionalLoadWithError_Params& params) {} |
34 | 41 |
35 // A redirect was processed in |render_frame_host| during a provisional load. | 42 // A redirect was processed in |render_frame_host| during a provisional load. |
36 virtual void DidRedirectProvisionalLoad( | 43 virtual void DidRedirectProvisionalLoad( |
37 RenderFrameHostImpl* render_frame_host, | 44 RenderFrameHostImpl* render_frame_host, |
38 const GURL& validated_target_url) {} | 45 const GURL& validated_target_url) {} |
39 | 46 |
| 47 // A navigation was committed in |render_frame_host|. |
| 48 virtual void DidCommitProvisionalLoad( |
| 49 int64 frame_id, |
| 50 const base::string16& frame_unique_name, |
| 51 bool is_main_frame, |
| 52 const GURL& url, |
| 53 PageTransition transition_type, |
| 54 RenderFrameHostImpl* render_frame_host) {} |
| 55 |
| 56 // Handles post-navigation tasks in navigation AFTER the entry has been |
| 57 // committed to the NavigationController. Note that the NavigationEntry is |
| 58 // not provided since it may be invalid/changed after being committed. The |
| 59 // NavigationController's last committed entry is for this navigation. |
| 60 virtual void DidNavigateMainFramePostCommit( |
| 61 const LoadCommittedDetails& details, |
| 62 const FrameHostMsg_DidCommitProvisionalLoad_Params& params) {} |
| 63 virtual void DidNavigateAnyFramePostCommit( |
| 64 RenderFrameHostImpl* render_frame_host, |
| 65 const LoadCommittedDetails& details, |
| 66 const FrameHostMsg_DidCommitProvisionalLoad_Params& params) {} |
| 67 |
| 68 virtual void SetMainFrameMimeType(const std::string& mime_type) {} |
| 69 virtual bool CanOverscrollContent(); |
| 70 |
40 // Notification to the Navigator embedder that navigation state has | 71 // Notification to the Navigator embedder that navigation state has |
41 // changed. This method corresponds to | 72 // changed. This method corresponds to |
42 // WebContents::NotifyNavigationStateChanged. | 73 // WebContents::NotifyNavigationStateChanged. |
43 virtual void NotifyChangedNavigationState(InvalidateTypes changed_flags) {} | 74 virtual void NotifyChangedNavigationState(InvalidateTypes changed_flags) {} |
44 | 75 |
45 // Notifies the Navigator embedder that it is beginning to navigate a frame. | 76 // Notifies the Navigator embedder that it is beginning to navigate a frame. |
46 virtual void AboutToNavigateRenderFrame( | 77 virtual void AboutToNavigateRenderFrame( |
47 RenderFrameHostImpl* render_frame_host) {} | 78 RenderFrameHostImpl* render_frame_host) {} |
48 | 79 |
49 // Notifies the Navigator embedder that a navigation to pending | 80 // Notifies the Navigator embedder that a navigation to pending |
50 // NavigationEntry has started in the browser process. | 81 // NavigationEntry has started in the browser process. |
51 virtual void DidStartNavigationToPendingEntry( | 82 virtual void DidStartNavigationToPendingEntry( |
52 RenderFrameHostImpl* render_frame_host, | 83 RenderFrameHostImpl* render_frame_host, |
53 const GURL& url, | 84 const GURL& url, |
54 NavigationController::ReloadType reload_type) {} | 85 NavigationController::ReloadType reload_type) {} |
55 }; | 86 }; |
56 | 87 |
57 } // namspace content | 88 } // namspace content |
58 | 89 |
59 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATOR_DELEGATE_H_ | 90 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATOR_DELEGATE_H_ |
OLD | NEW |