Commit a53ee483 authored by Amirhossein Simjour's avatar Amirhossein Simjour Committed by Commit Bot

Add name to hosted_ui quad

This will make it easier to write tests and send events directly
to the dialog.

Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_vr;luci.chromium.try:win_optional_gpu_tests_rel
Change-Id: Ib9a25666a213e1279a6491bd61331b4e7c8321e4
Reviewed-on: https://chromium-review.googlesource.com/1012917
Commit-Queue: Amirhossein Simjour <asimjour@chromium.org>
Reviewed-by: default avatarYash Malik <ymalik@chromium.org>
Cr-Commit-Position: refs/heads/master@{#551008}
parent a6a54b3a
......@@ -79,6 +79,7 @@ static const char* g_ui_element_name_strings[] = {
"kOmniboxOuterLayout",
"kOmniboxShadow",
"k2dBrowsingHostedUi",
"k2dBrowsingHostedUiContent",
"k2dBrowsingVisibiltyControlForVoice",
"k2dBrowsingVisibilityControlForPrompt",
"k2dBrowsingVisibiltyControlForSiteInfoPrompt",
......@@ -126,6 +127,7 @@ static const char* g_ui_element_name_strings[] = {
"kBackgroundBottom",
"kWebVrFloor",
"kWebVrHostedUi",
"kWebVrHostedUiContent",
"kWebVrTimeoutRoot",
"kWebVrTimeoutSpinner",
"kWebVrBackground",
......
......@@ -78,6 +78,7 @@ enum UiElementName {
kOmniboxOuterLayout,
kOmniboxShadow,
k2dBrowsingHostedUi,
k2dBrowsingHostedUiContent,
k2dBrowsingVisibiltyControlForVoice,
k2dBrowsingVisibilityControlForPrompt,
k2dBrowsingVisibiltyControlForSiteInfoPrompt,
......@@ -125,6 +126,7 @@ enum UiElementName {
kBackgroundBottom,
kWebVrFloor,
kWebVrHostedUi,
kWebVrHostedUiContent,
kWebVrTimeoutRoot,
kWebVrTimeoutSpinner,
kWebVrBackground,
......
......@@ -677,9 +677,11 @@ std::unique_ptr<UiElement> CreateHostedUi(
UiBrowserInterface* browser,
ContentInputDelegate* content_input_delegate,
UiElementName name,
UiElementName content_name,
float distance) {
auto hosted_ui = Create<ContentElement>(
kNone, kPhaseForeground, content_input_delegate, base::DoNothing());
auto hosted_ui =
Create<ContentElement>(content_name, kPhaseForeground,
content_input_delegate, base::DoNothing());
hosted_ui->SetSize(kContentWidth * kHostedUiWidthRatio,
kContentHeight * kHostedUiHeightRatio);
// The hosted UI doesn't steal focus so that clikcing on an autofill
......@@ -882,9 +884,9 @@ void UiSceneCreator::CreateScene() {
}
void UiSceneCreator::Create2dBrowsingHostedUi() {
auto hosted_ui_root =
CreateHostedUi(model_, browser_, content_input_delegate_,
k2dBrowsingHostedUi, kContentDistance);
auto hosted_ui_root = CreateHostedUi(
model_, browser_, content_input_delegate_, k2dBrowsingHostedUi,
k2dBrowsingHostedUiContent, kContentDistance);
scene_->AddUiElement(k2dBrowsingRepositioner, std::move(hosted_ui_root));
}
......@@ -1304,7 +1306,7 @@ void UiSceneCreator::CreateWebVrSubtree() {
// This is needed to for accepting permissions in WebVR mode.
auto hosted_ui_root =
CreateHostedUi(model_, browser_, content_input_delegate_, kWebVrHostedUi,
kTimeoutScreenDisatance);
kWebVrHostedUiContent, kTimeoutScreenDisatance);
scene_->AddUiElement(kWebVrViewportAwareRoot, std::move(hosted_ui_root));
// Note, this cannot be a descendant of the viewport aware root, otherwise it
......
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