OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_PUBLIC_BROWSER_WEB_CONTENTS_OBSERVER_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_OBSERVER_H_ |
6 #define CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_OBSERVER_H_ | 6 #define CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_OBSERVER_H_ |
7 | 7 |
8 #include "base/process_util.h" | 8 #include "base/process_util.h" |
9 #include "content/common/content_export.h" | 9 #include "content/common/content_export.h" |
10 #include "content/public/browser/navigation_controller.h" | 10 #include "content/public/browser/navigation_controller.h" |
11 #include "content/public/common/page_transition_types.h" | 11 #include "content/public/common/page_transition_types.h" |
12 #include "ipc/ipc_channel.h" | 12 #include "ipc/ipc_channel.h" |
13 #include "webkit/glue/window_open_disposition.h" | 13 #include "webkit/glue/window_open_disposition.h" |
14 | 14 |
15 class WebContentsImpl; | 15 class WebContentsImpl; |
16 | 16 |
17 namespace content { | 17 namespace content { |
18 | 18 |
19 class RenderViewHost; | 19 class RenderViewHost; |
20 class WebContents; | 20 class WebContents; |
21 struct FrameNavigateParams; | 21 struct FrameNavigateParams; |
22 struct LoadCommittedDetails; | 22 struct LoadCommittedDetails; |
23 struct Referrer; | 23 struct Referrer; |
24 | 24 |
25 // An observer API implemented by classes which are interested in various page | 25 // An observer API implemented by classes which are interested in various page |
26 // load events from WebContents. They also get a chance to filter IPC messages. | 26 // load events from WebContents. They also get a chance to filter IPC messages. |
27 class CONTENT_EXPORT WebContentsObserver : public IPC::Channel::Listener, | 27 class CONTENT_EXPORT WebContentsObserver : public IPC::Channel::Listener, |
28 public IPC::Message::Sender { | 28 public IPC::Message::Sender { |
29 public: | 29 public: |
| 30 // Only one of the two methods below will be called when a RVH is created for |
| 31 // a WebContents, depending on whether it's for an interstitial or not. |
30 virtual void RenderViewCreated(RenderViewHost* render_view_host) {} | 32 virtual void RenderViewCreated(RenderViewHost* render_view_host) {} |
| 33 virtual void RenderViewForInterstitialPageCreated( |
| 34 RenderViewHost* render_view_host) {} |
31 virtual void RenderViewDeleted(RenderViewHost* render_view_host) {} | 35 virtual void RenderViewDeleted(RenderViewHost* render_view_host) {} |
32 virtual void RenderViewReady() {} | 36 virtual void RenderViewReady() {} |
33 virtual void RenderViewGone(base::TerminationStatus status) {} | 37 virtual void RenderViewGone(base::TerminationStatus status) {} |
34 virtual void NavigateToPendingEntry( | 38 virtual void NavigateToPendingEntry( |
35 const GURL& url, | 39 const GURL& url, |
36 NavigationController::ReloadType reload_type) {} | 40 NavigationController::ReloadType reload_type) {} |
37 virtual void DidNavigateMainFrame( | 41 virtual void DidNavigateMainFrame( |
38 const LoadCommittedDetails& details, | 42 const LoadCommittedDetails& details, |
39 const FrameNavigateParams& params) {} | 43 const FrameNavigateParams& params) {} |
40 virtual void DidNavigateAnyFrame( | 44 virtual void DidNavigateAnyFrame( |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 void WebContentsImplDestroyed(); | 151 void WebContentsImplDestroyed(); |
148 | 152 |
149 WebContentsImpl* web_contents_; | 153 WebContentsImpl* web_contents_; |
150 | 154 |
151 DISALLOW_COPY_AND_ASSIGN(WebContentsObserver); | 155 DISALLOW_COPY_AND_ASSIGN(WebContentsObserver); |
152 }; | 156 }; |
153 | 157 |
154 } // namespace content | 158 } // namespace content |
155 | 159 |
156 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_OBSERVER_H_ | 160 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_OBSERVER_H_ |
OLD | NEW |