Commit 12a70aba authored by Alexander Cooper's avatar Alexander Cooper Committed by Commit Bot

[VR] Don't create text input delegates for VR UI

Now that it is impossible to enter the VR Browser, there is no need for
android to provide mechanisms for entering text. All child "UI" classes
allow for both the KeyboardDelegate and TextInputDelegates to be null,
so the browser renderer factory can simply stop creating the classes.

This is a speculative fix for the flaky tests described in the bug, and
full cleanup of the classes/codepaths that are always null will be done
at a future time.

Bug: 1114265
Change-Id: I26977ac0faaf504702465369b4a33a2169181b5e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2352519
Commit-Queue: Alexander Cooper <alcooper@chromium.org>
Commit-Queue: Klaus Weidner <klausw@chromium.org>
Auto-Submit: Alexander Cooper <alcooper@chromium.org>
Reviewed-by: default avatarKlaus Weidner <klausw@chromium.org>
Cr-Commit-Position: refs/heads/master@{#797547}
parent 488dfd5a
......@@ -10,13 +10,11 @@
#include "base/threading/thread_task_runner_handle.h"
#include "chrome/browser/android/vr/cardboard_input_delegate.h"
#include "chrome/browser/android/vr/gvr_input_delegate.h"
#include "chrome/browser/android/vr/gvr_keyboard_delegate.h"
#include "chrome/browser/android/vr/gvr_scheduler_delegate.h"
#include "chrome/browser/android/vr/ui_factory.h"
#include "chrome/browser/android/vr/vr_gl_thread.h"
#include "chrome/browser/vr/browser_renderer.h"
#include "chrome/browser/vr/sounds_manager_audio_delegate.h"
#include "chrome/browser/vr/text_input_delegate.h"
#include "chrome/browser/vr/ui_interface.h"
namespace {
......@@ -52,23 +50,12 @@ std::unique_ptr<BrowserRenderer> BrowserRendererFactory::Create(
UiFactory* ui_factory,
std::unique_ptr<Params> params) {
DCHECK(params);
auto keyboard_delegate = GvrKeyboardDelegate::Create();
auto text_input_delegate = std::make_unique<TextInputDelegate>();
if (!keyboard_delegate) {
params->ui_initial_state.needs_keyboard_update = true;
} else {
text_input_delegate->SetUpdateInputCallback(
base::BindRepeating(&KeyboardDelegate::UpdateInput,
base::Unretained(keyboard_delegate.get())));
}
params->ui_initial_state.gvr_input_support = !params->cardboard_gamepad;
auto audio_delegate = std::make_unique<SoundsManagerAudioDelegate>();
auto ui = ui_factory->Create(
vr_gl_thread, vr_gl_thread, std::move(keyboard_delegate),
std::move(text_input_delegate), std::move(audio_delegate),
params->ui_initial_state);
auto ui =
ui_factory->Create(vr_gl_thread, vr_gl_thread, nullptr, nullptr,
std::move(audio_delegate), params->ui_initial_state);
std::unique_ptr<InputDelegate> input_delegate;
if (params->cardboard_gamepad) {
input_delegate = std::make_unique<CardboardInputDelegate>(params->gvr_api);
......
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