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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 // This method is invoked when the RenderView of the current RenderViewHost | 90 // This method is invoked when the RenderView of the current RenderViewHost |
91 // is ready, e.g. because we recreated it after a crash. | 91 // is ready, e.g. because we recreated it after a crash. |
92 virtual void RenderViewReady() {} | 92 virtual void RenderViewReady() {} |
93 | 93 |
94 // This method is invoked when a RenderViewHost of the WebContents is | 94 // This method is invoked when a RenderViewHost of the WebContents is |
95 // deleted. Note that this does not always happen when the WebContents starts | 95 // deleted. Note that this does not always happen when the WebContents starts |
96 // to use a different RenderViewHost, as the old RenderViewHost might get | 96 // to use a different RenderViewHost, as the old RenderViewHost might get |
97 // just swapped out. | 97 // just swapped out. |
98 virtual void RenderViewDeleted(RenderViewHost* render_view_host) {} | 98 virtual void RenderViewDeleted(RenderViewHost* render_view_host) {} |
99 | 99 |
100 // This method is invoked when the process for the current RenderView crashes. | 100 // This method is invoked when the process for the current main |
101 // The WebContents continues to use the RenderViewHost, e.g. when the user | 101 // RenderFrameHost exits (usually by crashing, though possibly by other |
102 // reloads the current page. When the RenderViewHost itself is deleted, the | 102 // means). The WebContents continues to use the RenderFrameHost, e.g. when the |
103 // RenderViewDeleted method will be invoked. | 103 // user reloads the current page. When the RenderFrameHost itself is deleted, |
| 104 // the RenderFrameDeleted method will be invoked. |
104 // | 105 // |
105 // Note that this is equivalent to | 106 // Note that this is triggered upstream through |
106 // RenderProcessHostObserver::RenderProcessExited(). | 107 // RenderProcessHostObserver::RenderProcessExited(); for code that doesn't |
| 108 // otherwise need to be a WebContentsObserver, that API is probably a better |
| 109 // choice. |
107 virtual void RenderProcessGone(base::TerminationStatus status) {} | 110 virtual void RenderProcessGone(base::TerminationStatus status) {} |
108 | 111 |
109 // This method is invoked when a WebContents swaps its visible RenderViewHost | 112 // This method is invoked when a WebContents swaps its visible RenderViewHost |
110 // with another one, possibly changing processes. The RenderViewHost that has | 113 // with another one, possibly changing processes. The RenderViewHost that has |
111 // been replaced is in |old_host|, which is nullptr if the old RVH was shut | 114 // been replaced is in |old_host|, which is nullptr if the old RVH was shut |
112 // down. | 115 // down. |
113 virtual void RenderViewHostChanged(RenderViewHost* old_host, | 116 virtual void RenderViewHostChanged(RenderViewHost* old_host, |
114 RenderViewHost* new_host) {} | 117 RenderViewHost* new_host) {} |
115 | 118 |
116 // This method is invoked after the WebContents decides which RenderFrameHost | 119 // This method is invoked after the WebContents decides which RenderFrameHost |
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
407 void ResetWebContents(); | 410 void ResetWebContents(); |
408 | 411 |
409 WebContentsImpl* web_contents_; | 412 WebContentsImpl* web_contents_; |
410 | 413 |
411 DISALLOW_COPY_AND_ASSIGN(WebContentsObserver); | 414 DISALLOW_COPY_AND_ASSIGN(WebContentsObserver); |
412 }; | 415 }; |
413 | 416 |
414 } // namespace content | 417 } // namespace content |
415 | 418 |
416 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_OBSERVER_H_ | 419 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_OBSERVER_H_ |
OLD | NEW |