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/kill.h" | 8 #include "base/process/kill.h" |
9 #include "base/process/process_handle.h" | 9 #include "base/process/process_handle.h" |
10 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 class CONTENT_EXPORT WebContentsObserver : public IPC::Listener, | 45 class CONTENT_EXPORT WebContentsObserver : public IPC::Listener, |
46 public IPC::Sender { | 46 public IPC::Sender { |
47 public: | 47 public: |
48 // Called when a RenderFrameHost associated with this WebContents is created. | 48 // Called when a RenderFrameHost associated with this WebContents is created. |
49 virtual void RenderFrameCreated(RenderFrameHost* render_frame_host) {} | 49 virtual void RenderFrameCreated(RenderFrameHost* render_frame_host) {} |
50 | 50 |
51 // Called whenever a RenderFrameHost associated with this WebContents is | 51 // Called whenever a RenderFrameHost associated with this WebContents is |
52 // deleted. | 52 // deleted. |
53 virtual void RenderFrameDeleted(RenderFrameHost* render_frame_host) {} | 53 virtual void RenderFrameDeleted(RenderFrameHost* render_frame_host) {} |
54 | 54 |
55 // Only one of the two methods below will be called when a RVH is created for | 55 // This is called when a RVH is created for a WebContents, but not if it's an |
56 // a WebContents, depending on whether it's for an interstitial or not. | 56 // interstitial. |
57 virtual void RenderViewCreated(RenderViewHost* render_view_host) {} | 57 virtual void RenderViewCreated(RenderViewHost* render_view_host) {} |
58 virtual void RenderViewForInterstitialPageCreated( | 58 |
59 RenderViewHost* render_view_host) {} | 59 // Called for every RenderFrameHost that's created for an interstitial. |
| 60 virtual void RenderFrameForInterstitialPageCreated( |
| 61 RenderFrameHost* render_frame_host) {} |
60 | 62 |
61 // This method is invoked when the RenderView of the current RenderViewHost | 63 // This method is invoked when the RenderView of the current RenderViewHost |
62 // is ready, e.g. because we recreated it after a crash. | 64 // is ready, e.g. because we recreated it after a crash. |
63 virtual void RenderViewReady() {} | 65 virtual void RenderViewReady() {} |
64 | 66 |
65 // This method is invoked when a RenderViewHost of the WebContents is | 67 // This method is invoked when a RenderViewHost of the WebContents is |
66 // deleted. Note that this does not always happen when the WebContents starts | 68 // deleted. Note that this does not always happen when the WebContents starts |
67 // to use a different RenderViewHost, as the old RenderViewHost might get | 69 // to use a different RenderViewHost, as the old RenderViewHost might get |
68 // just swapped out. | 70 // just swapped out. |
69 virtual void RenderViewDeleted(RenderViewHost* render_view_host) {} | 71 virtual void RenderViewDeleted(RenderViewHost* render_view_host) {} |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
350 void WebContentsImplDestroyed(); | 352 void WebContentsImplDestroyed(); |
351 | 353 |
352 WebContentsImpl* web_contents_; | 354 WebContentsImpl* web_contents_; |
353 | 355 |
354 DISALLOW_COPY_AND_ASSIGN(WebContentsObserver); | 356 DISALLOW_COPY_AND_ASSIGN(WebContentsObserver); |
355 }; | 357 }; |
356 | 358 |
357 } // namespace content | 359 } // namespace content |
358 | 360 |
359 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_OBSERVER_H_ | 361 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_OBSERVER_H_ |
OLD | NEW |