Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 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 CHROME_BROWSER_WEBVIEW_WEBVIEW_GUEST_H_ | |
| 6 #define CHROME_BROWSER_WEBVIEW_WEBVIEW_GUEST_H_ | |
| 7 | |
| 8 #include "content/public/browser/web_contents_observer.h" | |
| 9 | |
| 10 namespace chrome { | |
| 11 | |
| 12 class WebViewGuest : public content::WebContentsObserver { | |
|
Matt Perry
2013/05/16 21:16:39
Please add comments to this class.
Fady Samuel
2013/05/17 03:02:33
Done.
| |
| 13 public: | |
| 14 WebViewGuest(content::WebContents* guest_web_contents, | |
| 15 content::WebContents* embedder_web_contents, | |
| 16 const std::string& extension_id); | |
| 17 virtual ~WebViewGuest(); | |
| 18 | |
| 19 static WebViewGuest* From(void* profile, int instance_id); | |
| 20 | |
| 21 content::WebContents* embedder_web_contents() const { | |
| 22 return embedder_web_contents_; | |
| 23 } | |
| 24 | |
| 25 content::WebContents* web_contents() const { | |
| 26 return WebContentsObserver::web_contents(); | |
| 27 } | |
| 28 private: | |
| 29 virtual void WebContentsDestroyed( | |
| 30 content::WebContents* web_contents) OVERRIDE; | |
| 31 | |
| 32 content::WebContents* embedder_web_contents_; | |
| 33 std::string extension_id_; | |
| 34 int embedder_render_process_id_; | |
| 35 // Profile and instance ID are cached here because |web_contents()| is | |
| 36 // null on destruction. | |
| 37 void* profile_; | |
| 38 int instance_id_; | |
| 39 }; | |
| 40 | |
| 41 } // namespace chrome | |
| 42 | |
| 43 #endif // CHROME_BROWSER_WEBVIEW_WEBVIEW_GUEST_H_ | |
| OLD | NEW |