Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(83)

Unified Diff: ui/views/controls/webview/webview.h

Issue 23477051: Embed Flash Fullscreen widget within browser window. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add caution comment to chrome_switches.cc. Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/public/browser/web_contents_delegate.cc ('k') | ui/views/controls/webview/webview.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/webview/webview.h
diff --git a/ui/views/controls/webview/webview.h b/ui/views/controls/webview/webview.h
index 05c447db8a944b98697f1dfac3bff85c6b5af40c..7e50914131c28fd7a3cef8d1c4cfe609eac9b3fd 100644
--- a/ui/views/controls/webview/webview.h
+++ b/ui/views/controls/webview/webview.h
@@ -10,6 +10,7 @@
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
#include "content/public/browser/web_contents_delegate.h"
+#include "content/public/browser/web_contents_observer.h"
#include "ui/views/accessibility/native_view_accessibility.h"
#include "ui/views/controls/webview/webview_export.h"
#include "ui/views/view.h"
@@ -24,7 +25,8 @@ class NativeViewHost;
class WEBVIEW_EXPORT WebView : public View,
public content::NotificationObserver,
- public content::WebContentsDelegate {
+ public content::WebContentsDelegate,
+ public content::WebContentsObserver {
public:
static const char kViewClassName[];
@@ -43,6 +45,12 @@ class WEBVIEW_EXPORT WebView : public View,
// those it implicitly creates via GetWebContents() above.
void SetWebContents(content::WebContents* web_contents);
+ // If |mode| is true, WebView will register itself with WebContents as a
+ // WebContentsObserver, monitor for the showing/destruction of fullscreen
+ // render widgets, and alter its child view hierarchy to embed the fullscreen
+ // widget or restore the normal WebContentsView.
+ void SetEmbedFullscreenWidgetMode(bool mode);
+
content::WebContents* web_contents() { return web_contents_; }
content::BrowserContext* browser_context() { return browser_context_; }
@@ -103,13 +111,19 @@ class WEBVIEW_EXPORT WebView : public View,
// Overridden from content::WebContentsDelegate:
virtual void WebContentsFocused(content::WebContents* web_contents) OVERRIDE;
+ virtual bool EmbedsFullscreenWidget() const OVERRIDE;
+
+ // Overridden from content::WebContentsObserver:
+ virtual void DidShowFullscreenWidget(int routing_id) OVERRIDE;
+ virtual void DidDestroyFullscreenWidget(int routing_id) OVERRIDE;
+ // Workaround for MSVC++ linker bug/feature that requires
+ // instantiation of the inline IPC::Listener methods in all translation units.
+ virtual void OnChannelConnected(int32 peer_id) OVERRIDE {}
+ virtual void OnChannelError() OVERRIDE {}
void AttachWebContents();
void DetachWebContents();
-
- void RenderViewHostChanged(content::RenderViewHost* old_host,
- content::RenderViewHost* new_host);
- void WebContentsDestroyed(content::WebContents* web_contents);
+ void ReattachForFullscreenChange(bool enter_fullscreen);
// Create a regular or test web contents (based on whether we're running
// in a unit test or not).
@@ -120,6 +134,12 @@ class WEBVIEW_EXPORT WebView : public View,
NativeViewHost* wcv_holder_;
scoped_ptr<content::WebContents> wc_owner_;
content::WebContents* web_contents_;
+ // When true, WebView observes WebContents and auto-embeds fullscreen widgets
+ // as a child view.
+ bool embed_fullscreen_widget_mode_enabled_;
+ // Set to true while WebView is embedding a fullscreen widget view as a child
+ // view instead of the normal WebContentsView render view.
+ bool is_embedding_fullscreen_widget_;
content::BrowserContext* browser_context_;
content::NotificationRegistrar registrar_;
bool allow_accelerators_;
« no previous file with comments | « content/public/browser/web_contents_delegate.cc ('k') | ui/views/controls/webview/webview.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698