Commit 1a076f1a authored by Elliot Glaysher's avatar Elliot Glaysher Committed by Commit Bot

Remove superfluous USE_OZONE guards.

Bug: 750642
Change-Id: Ib2b7167048a75a3b97e7df80ea21d1ca30ae5b1a
Reviewed-on: https://chromium-review.googlesource.com/598459Reviewed-by: default avatarScott Violet <sky@chromium.org>
Commit-Queue: Elliot Glaysher <erg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#491508}
parent 72892854
......@@ -68,10 +68,6 @@ include_rules = [
# TODO: This is temporary, ash should not use these. http://crbug.com/747415.
"+ui/events/devices/device_data_manager.h",
"+ui/events/devices/input_device_manager.h",
# X11 support isn't used in production and will go away soon.
# http://crbug.com/671355.
"+ui/events/devices/x11",
]
specific_include_rules = {
......
......@@ -142,14 +142,12 @@ bool ExtendedMouseWarpController::WarpMouseCursor(ui::MouseEvent* event) {
gfx::Point point_in_native =
ui::EventSystemLocationFromNative(event->native_event());
#if defined(USE_OZONE)
// TODO(dnicoara): crbug.com/415680 Move cursor warping into Ozone once Ozone
// has access to the logical display layout.
// Native events in Ozone are in the native window coordinate system. We need
// to translate them to get the global position.
point_in_native.Offset(target->GetHost()->GetBoundsInPixels().x(),
target->GetHost()->GetBoundsInPixels().y());
#endif
return WarpMouseCursorInNativeCoords(point_in_native, point_in_screen, false);
}
......
......@@ -35,7 +35,6 @@ AshWindowTreeHost* GetMirroringAshWindowTreeHostForDisplayId(
->GetAshWindowTreeHostForDisplayId(display_id);
}
#if defined(USE_OZONE)
// Find a WindowTreeHost used for mirroring displays that contains
// the |point_in_screen|. Returns nullptr if such WTH does not exist.
aura::WindowTreeHost* FindMirroringWindowTreeHostFromScreenPoint(
......@@ -49,7 +48,6 @@ aura::WindowTreeHost* FindMirroringWindowTreeHostFromScreenPoint(
return GetMirroringAshWindowTreeHostForDisplayId(iter->id())
->AsWindowTreeHost();
}
#endif
} // namespace
......@@ -95,7 +93,6 @@ bool UnifiedMouseWarpController::WarpMouseCursor(ui::MouseEvent* event) {
gfx::Point point_in_native =
ui::EventSystemLocationFromNative(event->native_event());
#if defined(USE_OZONE)
// TODO(dnicoara): crbug.com/415680 Move cursor warping into Ozone once Ozone
// has access to the logical display layout.
// Native events in Ozone are in the native window coordinate system. We need
......@@ -106,7 +103,6 @@ bool UnifiedMouseWarpController::WarpMouseCursor(ui::MouseEvent* event) {
return false;
point_in_native.Offset(host->GetBoundsInPixels().x(),
host->GetBoundsInPixels().y());
#endif
return WarpMouseCursorInNativeCoords(point_in_native, point_in_unified_host,
update_location_for_test_);
......
......@@ -72,14 +72,9 @@ class UnifiedMouseWarpControllerTest : public AshTestBase {
&point_in_mirroring_host, &point_in_unified_host)) {
return false;
}
#if defined(USE_OZONE)
// The location of the ozone's native event is relative to the host.
GetEventGenerator().MoveMouseToWithNative(point_in_unified_host,
point_in_mirroring_host);
#else
GetEventGenerator().MoveMouseToWithNative(point_in_unified_host,
point_in_native);
#endif
aura::Window* root = Shell::GetPrimaryRootWindow();
gfx::Point new_location_in_unified_host =
aura::Env::GetInstance()->last_mouse_location();
......
......@@ -17,9 +17,4 @@ specific_include_rules = {
# ozone.
"+ui/events/ozone/chromeos/cursor_controller.h",
],
# X11 support isn't used and will be removed soon, so it can depend on
# whatever.
"ash_window_tree_host_x11.cc": [
"+ui/events/devices",
],
}
......@@ -49,11 +49,9 @@ class ASH_EXPORT AshWindowTreeHost {
virtual void RegisterMirroringHost(AshWindowTreeHost* mirroring_ash_host) {}
#if defined(USE_OZONE)
virtual void SetCursorConfig(const display::Display& display,
display::Display::Rotation rotation) = 0;
virtual void ClearCursorConfig() = 0;
#endif
protected:
// Translates the native mouse location into screen coordinates.
......
......@@ -11,20 +11,17 @@
#include "ash/shell.h"
#include "ash/shell_delegate.h"
#include "base/trace_event/trace_event.h"
#include "services/ui/public/cpp/input_devices/input_device_controller_client.h"
#include "services/ui/public/interfaces/window_manager.mojom.h"
#include "ui/aura/window.h"
#include "ui/aura/window_tree_host_platform.h"
#include "ui/events/event_sink.h"
#include "ui/events/null_event_targeter.h"
#include "ui/events/ozone/chromeos/cursor_controller.h"
#include "ui/gfx/geometry/insets.h"
#include "ui/gfx/transform.h"
#include "ui/platform_window/platform_window.h"
#if defined(USE_OZONE)
#include "services/ui/public/cpp/input_devices/input_device_controller_client.h"
#include "services/ui/public/interfaces/window_manager.mojom.h"
#include "ui/events/ozone/chromeos/cursor_controller.h"
#endif
namespace ash {
AshWindowTreeHostPlatform::AshWindowTreeHostPlatform(
......@@ -48,7 +45,6 @@ bool AshWindowTreeHostPlatform::ConfineCursorToRootWindow() {
return true;
}
#if defined(USE_OZONE)
void AshWindowTreeHostPlatform::SetCursorConfig(
const display::Display& display,
display::Display::Rotation rotation) {
......@@ -66,7 +62,6 @@ void AshWindowTreeHostPlatform::ClearCursorConfig() {
ui::CursorController::GetInstance()->ClearCursorConfigForWindow(
GetAcceleratedWidget());
}
#endif
void AshWindowTreeHostPlatform::SetRootWindowTransformer(
std::unique_ptr<RootWindowTransformer> transformer) {
......@@ -130,7 +125,6 @@ void AshWindowTreeHostPlatform::DispatchEvent(ui::Event* event) {
}
void AshWindowTreeHostPlatform::SetTapToClickPaused(bool state) {
#if defined(USE_OZONE)
ui::InputDeviceControllerClient* input_device_controller_client =
Shell::Get()->shell_delegate()->GetInputDeviceControllerClient();
if (!input_device_controller_client)
......@@ -138,7 +132,6 @@ void AshWindowTreeHostPlatform::SetTapToClickPaused(bool state) {
// Temporarily pause tap-to-click when the cursor is hidden.
input_device_controller_client->SetTapToClickPaused(state);
#endif
}
} // namespace ash
......@@ -31,11 +31,9 @@ class ASH_EXPORT AshWindowTreeHostPlatform
gfx::Insets GetHostInsets() const override;
aura::WindowTreeHost* AsWindowTreeHost() override;
void PrepareForShutdown() override;
#if defined(USE_OZONE)
void SetCursorConfig(const display::Display& display,
display::Display::Rotation rotation) override;
void ClearCursorConfig() override;
#endif
// aura::WindowTreeHostPlatform:
void SetRootTransform(const gfx::Transform& transform) override;
......
......@@ -9,15 +9,12 @@
#include "ash/shell.h"
#include "ash/shell_delegate.h"
#include "base/memory/ptr_util.h"
#include "services/ui/public/cpp/input_devices/input_device_controller_client.h"
#include "ui/aura/mus/window_tree_host_mus_init_params.h"
#include "ui/aura/window.h"
#include "ui/events/event_sink.h"
#include "ui/events/null_event_targeter.h"
#if defined(USE_OZONE)
#include "services/ui/public/cpp/input_devices/input_device_controller_client.h"
#endif
namespace ash {
AshWindowTreeHostMus::AshWindowTreeHostMus(
......@@ -68,7 +65,6 @@ void AshWindowTreeHostMus::RegisterMirroringHost(
NOTIMPLEMENTED();
}
#if defined(USE_OZONE)
void AshWindowTreeHostMus::SetCursorConfig(
const display::Display& display,
display::Display::Rotation rotation) {
......@@ -78,7 +74,6 @@ void AshWindowTreeHostMus::SetCursorConfig(
void AshWindowTreeHostMus::ClearCursorConfig() {
// Nothing to do here, mus takes care of this.
}
#endif
void AshWindowTreeHostMus::SetRootTransform(const gfx::Transform& transform) {
transformer_helper_->SetTransform(transform);
......@@ -98,7 +93,6 @@ void AshWindowTreeHostMus::UpdateRootWindowSizeInPixels(
}
void AshWindowTreeHostMus::OnCursorVisibilityChangedNative(bool show) {
#if defined(USE_OZONE)
ui::InputDeviceControllerClient* input_device_controller_client =
Shell::Get()->shell_delegate()->GetInputDeviceControllerClient();
if (!input_device_controller_client)
......@@ -106,7 +100,6 @@ void AshWindowTreeHostMus::OnCursorVisibilityChangedNative(bool show) {
// Temporarily pause tap-to-click when the cursor is hidden.
input_device_controller_client->SetTapToClickPaused(!show);
#endif
}
} // namespace ash
......@@ -27,11 +27,9 @@ class AshWindowTreeHostMus : public AshWindowTreeHost,
aura::WindowTreeHost* AsWindowTreeHost() override;
void PrepareForShutdown() override;
void RegisterMirroringHost(AshWindowTreeHost* mirroring_ash_host) override;
#if defined(USE_OZONE)
void SetCursorConfig(const display::Display& display,
display::Display::Rotation rotation) override;
void ClearCursorConfig() override;
#endif
// aura::WindowTreeHostMus:
void SetRootTransform(const gfx::Transform& transform) override;
......
......@@ -50,13 +50,10 @@
#include "ui/aura/mus/window_tree_host_mus_init_params.h"
#include "ui/aura/window.h"
#include "ui/display/manager/display_manager.h"
#include "ui/display/manager/forwarding_display_delegate.h"
#include "ui/display/types/native_display_delegate.h"
#include "ui/views/mus/pointer_watcher_event_router.h"
#if defined(USE_OZONE)
#include "ui/display/manager/forwarding_display_delegate.h"
#endif
namespace ash {
namespace mus {
......@@ -354,7 +351,6 @@ void ShellPortMash::OnHostsInitialized() {
std::unique_ptr<display::NativeDisplayDelegate>
ShellPortMash::CreateNativeDisplayDelegate() {
#if defined(USE_OZONE)
display::mojom::NativeDisplayDelegatePtr native_display_delegate;
if (window_manager_->connector()) {
window_manager_->connector()->BindInterface(ui::mojom::kServiceName,
......@@ -362,11 +358,6 @@ ShellPortMash::CreateNativeDisplayDelegate() {
}
return base::MakeUnique<display::ForwardingDisplayDelegate>(
std::move(native_display_delegate));
#else
// The bots compile this config, but it is never run.
CHECK(false);
return nullptr;
#endif
}
std::unique_ptr<AcceleratorController>
......
......@@ -18,10 +18,7 @@
#include "components/user_manager/user_info_impl.h"
#include "ui/gfx/image/image.h"
#include "ui/keyboard/keyboard_ui.h"
#if defined(USE_OZONE)
#include "services/ui/public/cpp/input_devices/input_device_controller_client.h"
#endif
namespace ash {
......@@ -157,7 +154,6 @@ void ShellDelegateMus::UpdateTouchscreenStatusFromPrefs() {
NOTIMPLEMENTED();
}
#if defined(USE_OZONE)
ui::InputDeviceControllerClient*
ShellDelegateMus::GetInputDeviceControllerClient() {
if (!connector_)
......@@ -169,6 +165,5 @@ ShellDelegateMus::GetInputDeviceControllerClient() {
}
return input_device_controller_client_.get();
}
#endif
} // namespace ash
......@@ -50,18 +50,14 @@ class ShellDelegateMus : public ShellDelegate {
void SetTouchscreenEnabledInPrefs(bool enabled,
bool use_local_state) override;
void UpdateTouchscreenStatusFromPrefs() override;
#if defined(USE_OZONE)
ui::InputDeviceControllerClient* GetInputDeviceControllerClient() override;
#endif
private:
// |connector_| may be null in tests.
service_manager::Connector* connector_;
#if defined(USE_OZONE)
std::unique_ptr<ui::InputDeviceControllerClient>
input_device_controller_client_;
#endif
DISALLOW_COPY_AND_ASSIGN(ShellDelegateMus);
};
......
......@@ -159,12 +159,10 @@ void ShellDelegateImpl::SetTouchscreenEnabledInPrefs(bool enabled,
void ShellDelegateImpl::UpdateTouchscreenStatusFromPrefs() {}
#if defined(USE_OZONE)
ui::InputDeviceControllerClient*
ShellDelegateImpl::GetInputDeviceControllerClient() {
return nullptr;
}
#endif
} // namespace shell
} // namespace ash
......@@ -52,9 +52,7 @@ class ShellDelegateImpl : public ShellDelegate {
void SetTouchscreenEnabledInPrefs(bool enabled,
bool use_local_state) override;
void UpdateTouchscreenStatusFromPrefs() override;
#if defined(USE_OZONE)
ui::InputDeviceControllerClient* GetInputDeviceControllerClient() override;
#endif
private:
DISALLOW_COPY_AND_ASSIGN(ShellDelegateImpl);
......
......@@ -32,9 +32,7 @@ class Connector;
}
namespace ui {
#if defined(USE_OZONE)
class InputDeviceControllerClient;
#endif
class MenuModel;
}
......@@ -147,10 +145,8 @@ class ASH_EXPORT ShellDelegate {
// Suspends all WebContents-associated media sessions to stop managed players.
virtual void SuspendMediaSessions() {}
#if defined(USE_OZONE)
// Creator of Shell owns this; it's assumed this outlives Shell.
virtual ui::InputDeviceControllerClient* GetInputDeviceControllerClient() = 0;
#endif
};
} // namespace ash
......
......@@ -160,11 +160,9 @@ void TestShellDelegate::SuspendMediaSessions() {
media_sessions_suspended_ = true;
}
#if defined(USE_OZONE)
ui::InputDeviceControllerClient*
TestShellDelegate::GetInputDeviceControllerClient() {
return nullptr;
}
#endif
} // namespace ash
......@@ -64,9 +64,7 @@ class TestShellDelegate : public ShellDelegate {
bool use_local_state) override;
void UpdateTouchscreenStatusFromPrefs() override;
void SuspendMediaSessions() override;
#if defined(USE_OZONE)
ui::InputDeviceControllerClient* GetInputDeviceControllerClient() override;
#endif
int num_exit_requests() const { return num_exit_requests_; }
......
......@@ -13,13 +13,10 @@
#include "ui/aura/window_event_dispatcher.h"
#include "ui/aura/window_tree_host.h"
#include "ui/base/cursor/image_cursors.h"
#include "ui/base/cursor/ozone/cursor_data_factory_ozone.h"
#include "ui/base/layout.h"
#include "ui/wm/core/cursor_manager.h"
#if defined(USE_OZONE)
#include "ui/base/cursor/ozone/cursor_data_factory_ozone.h"
#endif
namespace ash {
namespace {
......@@ -27,17 +24,10 @@ namespace {
void SetCursorOnAllRootWindows(gfx::NativeCursor cursor) {
ui::CursorData mojo_cursor;
if (cursor.platform()) {
#if defined(USE_OZONE)
if (cursor.platform())
mojo_cursor = ui::CursorDataFactoryOzone::GetCursorData(cursor.platform());
#else
NOTIMPLEMENTED()
<< "Can't pass native platform cursors on non-ozone platforms";
mojo_cursor = ui::CursorData(ui::CursorType::kPointer);
#endif
} else {
else
mojo_cursor = ui::CursorData(cursor.native_type());
}
// As the window manager, tell mus to use |mojo_cursor| everywhere. We do
// this instead of trying to set per-window because otherwise we run into the
......@@ -82,16 +72,14 @@ void NotifyMouseEventsEnableStateChange(bool enabled) {
} // namespace
NativeCursorManagerAshMus::NativeCursorManagerAshMus() {
#if defined(USE_OZONE)
// If we're in a mus client, we aren't going to have all of ozone initialized
// even though we're in an ozone build. All the hard coded USE_OZONE ifdefs
// that handle cursor code expect that there will be a CursorFactoryOzone
// instance. Partially initialize the ozone cursor internals here, like we
// partially initialize other ozone subsystems in
// that handle cursor code in //content/ expect that there will be a
// CursorFactoryOzone instance. Partially initialize the ozone cursor
// internals here, like we partially initialize other ozone subsystems in
// ChromeBrowserMainExtraPartsViews.
cursor_factory_ozone_ = base::MakeUnique<ui::CursorDataFactoryOzone>();
image_cursors_ = base::MakeUnique<ui::ImageCursors>();
#endif
}
NativeCursorManagerAshMus::~NativeCursorManagerAshMus() = default;
......
......@@ -52,11 +52,8 @@ class ASH_EXPORT NativeCursorManagerAshMus : public NativeCursorManagerAsh {
bool native_cursor_enabled_ = true;
#if defined(USE_OZONE)
std::unique_ptr<ui::CursorDataFactoryOzone> cursor_factory_ozone_;
#endif
// Always nullptr when USE_OZONE is false.
std::unique_ptr<::ui::ImageCursors> image_cursors_;
DISALLOW_COPY_AND_ASSIGN(NativeCursorManagerAshMus);
......
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