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 @@
#include "content/public/common/content_switches.h"
#include "gpu/ipc/common/gpu_messages.h"
#include "skia/ext/platform_canvas.h"
#include "ui/base/ui_base_switches_util.h"
#include "ui/events/base_event_utils.h"
#include "ui/gfx/geometry/dip_util.h"
......@@ -400,7 +401,7 @@ void RenderWidgetHostViewGuest::SubmitCompositorFrame(
void RenderWidgetHostViewGuest::OnAttached() {
RegisterFrameSinkId();
#if defined(USE_AURA)
if (IsUsingMus()) {
if (switches::IsMusHostingViz()) {
aura::Env::GetInstance()->ScheduleEmbed(
GetWindowTreeClientFromRenderer(),
base::BindOnce(&RenderWidgetHostViewGuest::OnGotEmbedToken,
......
......@@ -69,6 +69,7 @@
#include "ui/base/dragdrop/os_exchange_data.h"
#include "ui/base/dragdrop/os_exchange_data_provider_factory.h"
#include "ui/base/hit_test.h"
#include "ui/base/ui_base_switches_util.h"
#include "ui/compositor/layer.h"
#include "ui/display/display.h"
#include "ui/display/screen.h"
......@@ -529,8 +530,9 @@ void WebContentsViewAura::InstallCreateHookForTests(
WebContentsViewAura::WebContentsViewAura(WebContentsImpl* web_contents,
WebContentsViewDelegate* delegate)
: is_mus_browser_plugin_guest_(
web_contents->GetBrowserPluginGuest() != nullptr && IsUsingMus()),
: is_mus_browser_plugin_guest_(web_contents->GetBrowserPluginGuest() !=
nullptr &&
(switches::IsMusHostingViz())),
web_contents_(web_contents),
delegate_(delegate),
current_drag_op_(blink::kWebDragOperationNone),
......
......@@ -20,6 +20,7 @@
#include "content/public/browser/web_contents_delegate.h"
#include "content/public/common/context_menu_params.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/rect.h"
#include "ui/gfx/geometry/size.h"
......@@ -78,14 +79,14 @@ void WebContentsViewGuest::OnGuestAttached(WebContentsView* parent_view) {
// view hierarchy. We add this view as embedder's child here.
// This would go in WebContentsViewGuest::CreateView, but that is too early to
// access embedder_web_contents(). Therefore, we do it here.
if (!IsUsingMus())
if (!switches::IsMusHostingViz())
parent_view->GetNativeView()->AddChild(platform_view_->GetNativeView());
#endif // defined(USE_AURA)
}
void WebContentsViewGuest::OnGuestDetached(WebContentsView* old_parent_view) {
#if defined(USE_AURA)
if (!IsUsingMus()) {
if (!switches::IsMusHostingViz()) {
old_parent_view->GetNativeView()->RemoveChild(
platform_view_->GetNativeView());
}
......
......@@ -46,6 +46,7 @@
#include "third_party/WebKit/public/web/WebLocalFrame.h"
#include "third_party/WebKit/public/web/WebPluginContainer.h"
#include "third_party/WebKit/public/web/WebView.h"
#include "ui/base/ui_base_switches_util.h"
#include "ui/events/keycodes/keyboard_codes.h"
#if defined(USE_AURA)
......@@ -141,7 +142,7 @@ void BrowserPlugin::OnSetChildFrameSurface(
int browser_plugin_instance_id,
const viz::SurfaceInfo& surface_info,
const viz::SurfaceSequence& sequence) {
if (!attached() || IsRunningWithMus())
if (!attached() || switches::IsMusHostingViz())
return;
if (!enable_surface_synchronization_) {
......@@ -359,7 +360,7 @@ void BrowserPlugin::OnSetMouseLock(int browser_plugin_instance_id,
void BrowserPlugin::OnSetMusEmbedToken(
int instance_id,
const base::UnguessableToken& embed_token) {
DCHECK(IsRunningWithMus());
DCHECK(switches::IsMusHostingViz());
if (!attached_) {
pending_embed_token_ = embed_token;
} 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