Commit 07094984 authored by Scott Violet's avatar Scott Violet Committed by Commit Bot

chromeos: make webviewguest work with ui-service and not viz

When the ui-service is running without viz we need to run some of the
classic behavior (around creating frame ids). This patch updates a
handful of sites.

BUG=786453
TEST=none

Change-Id: I61bef556e8fb21e467741619736067df01c3af88
Reviewed-on: https://chromium-review.googlesource.com/804194Reviewed-by: default avatarSadrul Chowdhury <sadrul@chromium.org>
Commit-Queue: Scott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#521399}
parent 12b7c20c
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
#include "content/public/common/content_switches.h" #include "content/public/common/content_switches.h"
#include "gpu/ipc/common/gpu_messages.h" #include "gpu/ipc/common/gpu_messages.h"
#include "skia/ext/platform_canvas.h" #include "skia/ext/platform_canvas.h"
#include "ui/base/ui_base_switches_util.h"
#include "ui/events/base_event_utils.h" #include "ui/events/base_event_utils.h"
#include "ui/gfx/geometry/dip_util.h" #include "ui/gfx/geometry/dip_util.h"
...@@ -400,7 +401,7 @@ void RenderWidgetHostViewGuest::SubmitCompositorFrame( ...@@ -400,7 +401,7 @@ void RenderWidgetHostViewGuest::SubmitCompositorFrame(
void RenderWidgetHostViewGuest::OnAttached() { void RenderWidgetHostViewGuest::OnAttached() {
RegisterFrameSinkId(); RegisterFrameSinkId();
#if defined(USE_AURA) #if defined(USE_AURA)
if (IsUsingMus()) { if (switches::IsMusHostingViz()) {
aura::Env::GetInstance()->ScheduleEmbed( aura::Env::GetInstance()->ScheduleEmbed(
GetWindowTreeClientFromRenderer(), GetWindowTreeClientFromRenderer(),
base::BindOnce(&RenderWidgetHostViewGuest::OnGotEmbedToken, base::BindOnce(&RenderWidgetHostViewGuest::OnGotEmbedToken,
......
...@@ -69,6 +69,7 @@ ...@@ -69,6 +69,7 @@
#include "ui/base/dragdrop/os_exchange_data.h" #include "ui/base/dragdrop/os_exchange_data.h"
#include "ui/base/dragdrop/os_exchange_data_provider_factory.h" #include "ui/base/dragdrop/os_exchange_data_provider_factory.h"
#include "ui/base/hit_test.h" #include "ui/base/hit_test.h"
#include "ui/base/ui_base_switches_util.h"
#include "ui/compositor/layer.h" #include "ui/compositor/layer.h"
#include "ui/display/display.h" #include "ui/display/display.h"
#include "ui/display/screen.h" #include "ui/display/screen.h"
...@@ -529,8 +530,9 @@ void WebContentsViewAura::InstallCreateHookForTests( ...@@ -529,8 +530,9 @@ void WebContentsViewAura::InstallCreateHookForTests(
WebContentsViewAura::WebContentsViewAura(WebContentsImpl* web_contents, WebContentsViewAura::WebContentsViewAura(WebContentsImpl* web_contents,
WebContentsViewDelegate* delegate) WebContentsViewDelegate* delegate)
: is_mus_browser_plugin_guest_( : is_mus_browser_plugin_guest_(web_contents->GetBrowserPluginGuest() !=
web_contents->GetBrowserPluginGuest() != nullptr && IsUsingMus()), nullptr &&
(switches::IsMusHostingViz())),
web_contents_(web_contents), web_contents_(web_contents),
delegate_(delegate), delegate_(delegate),
current_drag_op_(blink::kWebDragOperationNone), current_drag_op_(blink::kWebDragOperationNone),
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include "content/public/browser/web_contents_delegate.h" #include "content/public/browser/web_contents_delegate.h"
#include "content/public/common/context_menu_params.h" #include "content/public/common/context_menu_params.h"
#include "content/public/common/drop_data.h" #include "content/public/common/drop_data.h"
#include "ui/base/ui_base_switches_util.h"
#include "ui/gfx/geometry/point.h" #include "ui/gfx/geometry/point.h"
#include "ui/gfx/geometry/rect.h" #include "ui/gfx/geometry/rect.h"
#include "ui/gfx/geometry/size.h" #include "ui/gfx/geometry/size.h"
...@@ -78,14 +79,14 @@ void WebContentsViewGuest::OnGuestAttached(WebContentsView* parent_view) { ...@@ -78,14 +79,14 @@ void WebContentsViewGuest::OnGuestAttached(WebContentsView* parent_view) {
// view hierarchy. We add this view as embedder's child here. // view hierarchy. We add this view as embedder's child here.
// This would go in WebContentsViewGuest::CreateView, but that is too early to // This would go in WebContentsViewGuest::CreateView, but that is too early to
// access embedder_web_contents(). Therefore, we do it here. // access embedder_web_contents(). Therefore, we do it here.
if (!IsUsingMus()) if (!switches::IsMusHostingViz())
parent_view->GetNativeView()->AddChild(platform_view_->GetNativeView()); parent_view->GetNativeView()->AddChild(platform_view_->GetNativeView());
#endif // defined(USE_AURA) #endif // defined(USE_AURA)
} }
void WebContentsViewGuest::OnGuestDetached(WebContentsView* old_parent_view) { void WebContentsViewGuest::OnGuestDetached(WebContentsView* old_parent_view) {
#if defined(USE_AURA) #if defined(USE_AURA)
if (!IsUsingMus()) { if (!switches::IsMusHostingViz()) {
old_parent_view->GetNativeView()->RemoveChild( old_parent_view->GetNativeView()->RemoveChild(
platform_view_->GetNativeView()); platform_view_->GetNativeView());
} }
......
...@@ -46,6 +46,7 @@ ...@@ -46,6 +46,7 @@
#include "third_party/WebKit/public/web/WebLocalFrame.h" #include "third_party/WebKit/public/web/WebLocalFrame.h"
#include "third_party/WebKit/public/web/WebPluginContainer.h" #include "third_party/WebKit/public/web/WebPluginContainer.h"
#include "third_party/WebKit/public/web/WebView.h" #include "third_party/WebKit/public/web/WebView.h"
#include "ui/base/ui_base_switches_util.h"
#include "ui/events/keycodes/keyboard_codes.h" #include "ui/events/keycodes/keyboard_codes.h"
#if defined(USE_AURA) #if defined(USE_AURA)
...@@ -141,7 +142,7 @@ void BrowserPlugin::OnSetChildFrameSurface( ...@@ -141,7 +142,7 @@ void BrowserPlugin::OnSetChildFrameSurface(
int browser_plugin_instance_id, int browser_plugin_instance_id,
const viz::SurfaceInfo& surface_info, const viz::SurfaceInfo& surface_info,
const viz::SurfaceSequence& sequence) { const viz::SurfaceSequence& sequence) {
if (!attached() || IsRunningWithMus()) if (!attached() || switches::IsMusHostingViz())
return; return;
if (!enable_surface_synchronization_) { if (!enable_surface_synchronization_) {
...@@ -359,7 +360,7 @@ void BrowserPlugin::OnSetMouseLock(int browser_plugin_instance_id, ...@@ -359,7 +360,7 @@ void BrowserPlugin::OnSetMouseLock(int browser_plugin_instance_id,
void BrowserPlugin::OnSetMusEmbedToken( void BrowserPlugin::OnSetMusEmbedToken(
int instance_id, int instance_id,
const base::UnguessableToken& embed_token) { const base::UnguessableToken& embed_token) {
DCHECK(IsRunningWithMus()); DCHECK(switches::IsMusHostingViz());
if (!attached_) { if (!attached_) {
pending_embed_token_ = embed_token; pending_embed_token_ = embed_token;
} else { } else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment