e91827769f30f4925e14e39bda67c35cd2962934
[platform/framework/web/crosswalk.git] / src / content / browser / frame_host / navigator_delegate.h
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
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_BROWSER_FRAME_HOST_NAVIGATOR_DELEGATE_H_
6 #define CONTENT_BROWSER_FRAME_HOST_NAVIGATOR_DELEGATE_H_
7
8 #include "content/public/browser/invalidate_type.h"
9 #include "content/public/browser/navigation_controller.h"
10
11 namespace content {
12
13 class RenderFrameHost;
14
15 // A delegate API used by Navigator to notify its embedder of navigation
16 // related events.
17 class NavigatorDelegate {
18  public:
19   // The RenderFrameHost started a provisional load for the frame
20   // represented by |render_frame_host|.
21   virtual void DidStartProvisionalLoad(
22       RenderFrameHostImpl* render_frame_host,
23       int64 frame_id,
24       int64 parent_frame_id,
25       bool is_main_frame,
26       const GURL& validated_url,
27       bool is_error_page,
28       bool is_iframe_srcdoc) {}
29
30   // A provisional load in |render_frame_host| failed.
31   virtual void DidFailProvisionalLoadWithError(
32       RenderFrameHostImpl* render_frame_host,
33       const FrameHostMsg_DidFailProvisionalLoadWithError_Params& params) {}
34
35   // A redirect was processed in |render_frame_host| during a provisional load.
36   virtual void DidRedirectProvisionalLoad(
37       RenderFrameHostImpl* render_frame_host,
38       const GURL& validated_target_url) {}
39
40   // Notification to the Navigator embedder that navigation state has
41   // changed. This method corresponds to
42   // WebContents::NotifyNavigationStateChanged.
43   virtual void NotifyChangedNavigationState(InvalidateTypes changed_flags) {}
44
45   // Notifies the Navigator embedder that it is beginning to navigate a frame.
46   virtual void AboutToNavigateRenderFrame(
47       RenderFrameHostImpl* render_frame_host) {}
48
49   // Notifies the Navigator embedder that a navigation to pending
50   // NavigationEntry has started in the browser process.
51   virtual void DidStartNavigationToPendingEntry(
52       RenderFrameHostImpl* render_frame_host,
53       const GURL& url,
54       NavigationController::ReloadType reload_type) {}
55 };
56
57 }  // namspace content
58
59 #endif  // CONTENT_BROWSER_FRAME_HOST_NAVIGATOR_DELEGATE_H_