Chromium Code Reviews| Index: chrome/browser/webview/webview_guest.h |
| diff --git a/chrome/browser/webview/webview_guest.h b/chrome/browser/webview/webview_guest.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..c9fbef9c5480dc0b25e233b0be8e63f053061c4c |
| --- /dev/null |
| +++ b/chrome/browser/webview/webview_guest.h |
| @@ -0,0 +1,46 @@ |
| +// Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROME_BROWSER_WEBVIEW_WEBVIEW_GUEST_H_ |
| +#define CHROME_BROWSER_WEBVIEW_WEBVIEW_GUEST_H_ |
| + |
| +#include "content/public/browser/web_contents_observer.h" |
| + |
| +namespace chrome { |
| + |
| +// A WebViewGuest is a WebContentsObserver on the guest WebContents of a |
| +// <webview> tag. It provides the browser-side implementation of the <webview> |
| +// API and manages the lifetime of <webview> extension events. |
| +class WebViewGuest : public content::WebContentsObserver { |
| + public: |
| + WebViewGuest(content::WebContents* guest_web_contents, |
| + content::WebContents* embedder_web_contents, |
| + const std::string& extension_id); |
| + virtual ~WebViewGuest(); |
| + |
| + static WebViewGuest* From(void* profile, int instance_id); |
| + |
| + content::WebContents* embedder_web_contents() const { |
| + return embedder_web_contents_; |
| + } |
| + |
| + content::WebContents* web_contents() const { |
| + return WebContentsObserver::web_contents(); |
| + } |
| + private: |
|
sky
2013/05/22 00:44:18
nit: newline between 30/31.
Fady Samuel
2013/05/23 04:37:38
Done.
|
| + virtual void WebContentsDestroyed( |
| + content::WebContents* web_contents) OVERRIDE; |
| + |
| + content::WebContents* embedder_web_contents_; |
| + std::string extension_id_; |
| + int embedder_render_process_id_; |
| + // Profile and instance ID are cached here because |web_contents()| is |
| + // null on destruction. |
| + void* profile_; |
|
sky
2013/05/22 00:44:18
Why void* here and all other places?
Fady Samuel
2013/05/23 04:37:38
Changed to Profile*.
|
| + int instance_id_; |
| +}; |
|
sky
2013/05/22 00:44:18
DISALLOW_...
Fady Samuel
2013/05/23 04:37:38
Done.
|
| + |
| +} // namespace chrome |
| + |
| +#endif // CHROME_BROWSER_WEBVIEW_WEBVIEW_GUEST_H_ |