| 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 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 // it's used for anything in case there's an exploited renderer. | 286 // it's used for anything in case there's an exploited renderer. |
| 287 virtual void PluginHungStatusChanged(int plugin_child_id, | 287 virtual void PluginHungStatusChanged(int plugin_child_id, |
| 288 const base::FilePath& plugin_path, | 288 const base::FilePath& plugin_path, |
| 289 bool is_hung) {} | 289 bool is_hung) {} |
| 290 | 290 |
| 291 // Invoked when WebContents::Clone() was used to clone a WebContents. | 291 // Invoked when WebContents::Clone() was used to clone a WebContents. |
| 292 virtual void DidCloneToNewWebContents(WebContents* old_web_contents, | 292 virtual void DidCloneToNewWebContents(WebContents* old_web_contents, |
| 293 WebContents* new_web_contents) {} | 293 WebContents* new_web_contents) {} |
| 294 | 294 |
| 295 // Invoked when the WebContents is being destroyed. Gives subclasses a chance | 295 // Invoked when the WebContents is being destroyed. Gives subclasses a chance |
| 296 // to cleanup. At the time this is invoked |web_contents()| returns NULL. | 296 // to cleanup. After the whole loop over all WebContentsObservers has been |
| 297 // It is safe to delete 'this' from here. | 297 // finished, web_contents() returns NULL. |
| 298 virtual void WebContentsDestroyed(WebContents* web_contents) {} | 298 virtual void WebContentsDestroyed() {} |
| 299 | 299 |
| 300 // Called when the user agent override for a WebContents has been changed. | 300 // Called when the user agent override for a WebContents has been changed. |
| 301 virtual void UserAgentOverrideSet(const std::string& user_agent) {} | 301 virtual void UserAgentOverrideSet(const std::string& user_agent) {} |
| 302 | 302 |
| 303 // Invoked when new FaviconURL candidates are received from the renderer. | 303 // Invoked when new FaviconURL candidates are received from the renderer. |
| 304 virtual void DidUpdateFaviconURL(const std::vector<FaviconURL>& candidates) {} | 304 virtual void DidUpdateFaviconURL(const std::vector<FaviconURL>& candidates) {} |
| 305 | 305 |
| 306 // Invoked when a pepper plugin creates and shows or destroys a fullscreen | 306 // Invoked when a pepper plugin creates and shows or destroys a fullscreen |
| 307 // render widget. | 307 // render widget. |
| 308 virtual void DidShowFullscreenWidget(int routing_id) {} | 308 virtual void DidShowFullscreenWidget(int routing_id) {} |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 virtual ~WebContentsObserver(); | 355 virtual ~WebContentsObserver(); |
| 356 | 356 |
| 357 // Start observing a different WebContents; used with the default constructor. | 357 // Start observing a different WebContents; used with the default constructor. |
| 358 void Observe(WebContents* web_contents); | 358 void Observe(WebContents* web_contents); |
| 359 | 359 |
| 360 WebContents* web_contents() const; | 360 WebContents* web_contents() const; |
| 361 | 361 |
| 362 private: | 362 private: |
| 363 friend class WebContentsImpl; | 363 friend class WebContentsImpl; |
| 364 | 364 |
| 365 // Invoked from WebContentsImpl. Invokes WebContentsDestroyed and NULL out | 365 void ResetWebContents(); |
| 366 // |web_contents_|. | |
| 367 void WebContentsImplDestroyed(); | |
| 368 | 366 |
| 369 WebContentsImpl* web_contents_; | 367 WebContentsImpl* web_contents_; |
| 370 | 368 |
| 371 DISALLOW_COPY_AND_ASSIGN(WebContentsObserver); | 369 DISALLOW_COPY_AND_ASSIGN(WebContentsObserver); |
| 372 }; | 370 }; |
| 373 | 371 |
| 374 } // namespace content | 372 } // namespace content |
| 375 | 373 |
| 376 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_OBSERVER_H_ | 374 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_OBSERVER_H_ |
| OLD | NEW |