Commit ee1effda authored by Maksim Sisov's avatar Maksim Sisov Committed by Commit Bot

X11 and Ozone: Remove duplicated methods that have zero or small delta

There are some methods in DWTHX11, which either have small or zero
delta with the methods implemented in DWTHPlatform.

Thus, either remove those or move to DWTHPlatform.

Bug: 990756
Change-Id: I4780286d1a68844a304f138c5e829b45f6829ebe
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1773071
Commit-Queue: Maksim Sisov <msisov@igalia.com>
Reviewed-by: default avatarThomas Anderson <thomasanderson@chromium.org>
Reviewed-by: default avatarScott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#693624}
parent 5282ec5e
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include "base/time/time.h" #include "base/time/time.h"
#include "ui/aura/client/aura_constants.h" #include "ui/aura/client/aura_constants.h"
#include "ui/aura/client/drag_drop_client.h" #include "ui/aura/client/drag_drop_client.h"
#include "ui/aura/client/focus_client.h"
#include "ui/aura/client/transient_window_client.h" #include "ui/aura/client/transient_window_client.h"
#include "ui/base/hit_test.h" #include "ui/base/hit_test.h"
#include "ui/display/display.h" #include "ui/display/display.h"
...@@ -284,22 +285,31 @@ void DesktopWindowTreeHostPlatform::StackAtTop() { ...@@ -284,22 +285,31 @@ void DesktopWindowTreeHostPlatform::StackAtTop() {
} }
void DesktopWindowTreeHostPlatform::CenterWindow(const gfx::Size& size) { void DesktopWindowTreeHostPlatform::CenterWindow(const gfx::Size& size) {
gfx::Rect bounds_to_center_in = GetWorkAreaBoundsInScreen(); gfx::Size size_in_pixels = ToPixelRect(gfx::Rect(size)).size();
gfx::Rect parent_bounds_in_pixels = ToPixelRect(GetWorkAreaBoundsInScreen());
// If there is a transient parent and it fits |size|, then center over it.
aura::Window* content_window = desktop_native_widget_aura_->content_window(); // If |window_|'s transient parent bounds are big enough to contain |size|,
if (wm::GetTransientParent(content_window)) { // use them instead.
gfx::Rect transient_parent_bounds = if (wm::GetTransientParent(content_window())) {
wm::GetTransientParent(content_window)->GetBoundsInScreen(); gfx::Rect transient_parent_rect =
if (transient_parent_bounds.height() >= size.height() && wm::GetTransientParent(content_window())->GetBoundsInScreen();
transient_parent_bounds.width() >= size.width()) { if (transient_parent_rect.height() >= size.height() &&
bounds_to_center_in = transient_parent_bounds; transient_parent_rect.width() >= size.width()) {
parent_bounds_in_pixels = ToPixelRect(transient_parent_rect);
} }
} }
gfx::Rect resulting_bounds(bounds_to_center_in); gfx::Rect window_bounds_in_pixels(
resulting_bounds.ClampToCenteredSize(size); parent_bounds_in_pixels.x() +
SetBoundsInDIP(resulting_bounds); (parent_bounds_in_pixels.width() - size_in_pixels.width()) / 2,
parent_bounds_in_pixels.y() +
(parent_bounds_in_pixels.height() - size_in_pixels.height()) / 2,
size_in_pixels.width(), size_in_pixels.height());
// Don't size the window bigger than the parent, otherwise the user may not be
// able to close or move it.
window_bounds_in_pixels.AdjustToFit(parent_bounds_in_pixels);
SetBoundsInPixels(window_bounds_in_pixels);
} }
void DesktopWindowTreeHostPlatform::GetWindowPlacement( void DesktopWindowTreeHostPlatform::GetWindowPlacement(
...@@ -311,12 +321,13 @@ void DesktopWindowTreeHostPlatform::GetWindowPlacement( ...@@ -311,12 +321,13 @@ void DesktopWindowTreeHostPlatform::GetWindowPlacement(
} }
gfx::Rect DesktopWindowTreeHostPlatform::GetWindowBoundsInScreen() const { gfx::Rect DesktopWindowTreeHostPlatform::GetWindowBoundsInScreen() const {
return gfx::ConvertRectToDIP(device_scale_factor(), GetBoundsInPixels()); return ToDIPRect(GetBoundsInPixels());
} }
gfx::Rect DesktopWindowTreeHostPlatform::GetClientAreaBoundsInScreen() const { gfx::Rect DesktopWindowTreeHostPlatform::GetClientAreaBoundsInScreen() const {
// View-to-screen coordinate system transformations depend on this returning // Attempts to calculate the rect by asking the NonClientFrameView what it
// the full window bounds, for example View::ConvertPointToScreen(). // thought its GetBoundsForClientView() were broke combobox drop down
// placement.
return GetWindowBoundsInScreen(); return GetWindowBoundsInScreen();
} }
...@@ -350,6 +361,7 @@ void DesktopWindowTreeHostPlatform::Activate() { ...@@ -350,6 +361,7 @@ void DesktopWindowTreeHostPlatform::Activate() {
} }
void DesktopWindowTreeHostPlatform::Deactivate() { void DesktopWindowTreeHostPlatform::Deactivate() {
ReleaseCapture();
platform_window()->Deactivate(); platform_window()->Deactivate();
} }
...@@ -415,8 +427,15 @@ bool DesktopWindowTreeHostPlatform::SetWindowTitle( ...@@ -415,8 +427,15 @@ bool DesktopWindowTreeHostPlatform::SetWindowTitle(
} }
void DesktopWindowTreeHostPlatform::ClearNativeFocus() { void DesktopWindowTreeHostPlatform::ClearNativeFocus() {
// TODO: needs PlatformWindow support. // This method is weird and misnamed. Instead of clearing the native focus,
NOTIMPLEMENTED_LOG_ONCE(); // it sets the focus to our content_window(), which will trigger a cascade
// of focus changes into views.
if (content_window() && aura::client::GetFocusClient(content_window()) &&
content_window()->Contains(
aura::client::GetFocusClient(content_window())->GetFocusedWindow())) {
aura::client::GetFocusClient(content_window())
->FocusWindow(content_window());
}
} }
Widget::MoveLoopResult DesktopWindowTreeHostPlatform::RunMoveLoop( Widget::MoveLoopResult DesktopWindowTreeHostPlatform::RunMoveLoop(
......
...@@ -25,7 +25,6 @@ ...@@ -25,7 +25,6 @@
#include "third_party/skia/include/core/SkPath.h" #include "third_party/skia/include/core/SkPath.h"
#include "ui/aura/client/aura_constants.h" #include "ui/aura/client/aura_constants.h"
#include "ui/aura/client/cursor_client.h" #include "ui/aura/client/cursor_client.h"
#include "ui/aura/client/focus_client.h"
#include "ui/aura/null_window_targeter.h" #include "ui/aura/null_window_targeter.h"
#include "ui/aura/window.h" #include "ui/aura/window.h"
#include "ui/aura/window_event_dispatcher.h" #include "ui/aura/window_event_dispatcher.h"
...@@ -42,8 +41,6 @@ ...@@ -42,8 +41,6 @@
#include "ui/events/devices/x11/device_list_cache_x11.h" #include "ui/events/devices/x11/device_list_cache_x11.h"
#include "ui/events/event.h" #include "ui/events/event.h"
#include "ui/events/event_utils.h" #include "ui/events/event_utils.h"
#include "ui/events/keyboard_hook.h"
#include "ui/events/keycodes/dom/dom_code.h"
#include "ui/events/platform/platform_event_source.h" #include "ui/events/platform/platform_event_source.h"
#include "ui/events/x/events_x_utils.h" #include "ui/events/x/events_x_utils.h"
#include "ui/events/x/x11_window_event_manager.h" #include "ui/events/x/x11_window_event_manager.h"
...@@ -53,7 +50,6 @@ ...@@ -53,7 +50,6 @@
#include "ui/gfx/path_x11.h" #include "ui/gfx/path_x11.h"
#include "ui/gfx/x/x11.h" #include "ui/gfx/x/x11.h"
#include "ui/gfx/x/x11_atom_cache.h" #include "ui/gfx/x/x11_atom_cache.h"
#include "ui/views/corewm/tooltip_aura.h"
#include "ui/views/linux_ui/linux_ui.h" #include "ui/views/linux_ui/linux_ui.h"
#include "ui/views/views_switches.h" #include "ui/views/views_switches.h"
#include "ui/views/widget/desktop_aura/desktop_drag_drop_client_aurax11.h" #include "ui/views/widget/desktop_aura/desktop_drag_drop_client_aurax11.h"
...@@ -292,14 +288,6 @@ void DesktopWindowTreeHostX11::OnNativeWidgetCreated( ...@@ -292,14 +288,6 @@ void DesktopWindowTreeHostX11::OnNativeWidgetCreated(
native_widget_delegate()->OnNativeWidgetCreated(); native_widget_delegate()->OnNativeWidgetCreated();
} }
void DesktopWindowTreeHostX11::OnWidgetInitDone() {}
void DesktopWindowTreeHostX11::OnActiveWindowChanged(bool active) {}
std::unique_ptr<corewm::Tooltip> DesktopWindowTreeHostX11::CreateTooltip() {
return base::WrapUnique(new corewm::TooltipAura);
}
std::unique_ptr<aura::client::DragDropClient> std::unique_ptr<aura::client::DragDropClient>
DesktopWindowTreeHostX11::CreateDragDropClient( DesktopWindowTreeHostX11::CreateDragDropClient(
DesktopNativeCursorManager* cursor_manager) { DesktopNativeCursorManager* cursor_manager) {
...@@ -359,10 +347,6 @@ void DesktopWindowTreeHostX11::CloseNow() { ...@@ -359,10 +347,6 @@ void DesktopWindowTreeHostX11::CloseNow() {
platform_window()->Close(); platform_window()->Close();
} }
aura::WindowTreeHost* DesktopWindowTreeHostX11::AsWindowTreeHost() {
return this;
}
void DesktopWindowTreeHostX11::Show(ui::WindowShowState show_state, void DesktopWindowTreeHostX11::Show(ui::WindowShowState show_state,
const gfx::Rect& restore_bounds) { const gfx::Rect& restore_bounds) {
if (compositor()) if (compositor())
...@@ -451,34 +435,6 @@ void DesktopWindowTreeHostX11::StackAtTop() { ...@@ -451,34 +435,6 @@ void DesktopWindowTreeHostX11::StackAtTop() {
GetXWindow()->StackAtTop(); GetXWindow()->StackAtTop();
} }
void DesktopWindowTreeHostX11::CenterWindow(const gfx::Size& size) {
gfx::Size size_in_pixels = ToPixelRect(gfx::Rect(size)).size();
gfx::Rect parent_bounds_in_pixels = ToPixelRect(GetWorkAreaBoundsInScreen());
// If |window_|'s transient parent bounds are big enough to contain |size|,
// use them instead.
if (wm::GetTransientParent(content_window())) {
gfx::Rect transient_parent_rect =
wm::GetTransientParent(content_window())->GetBoundsInScreen();
if (transient_parent_rect.height() >= size.height() &&
transient_parent_rect.width() >= size.width()) {
parent_bounds_in_pixels = ToPixelRect(transient_parent_rect);
}
}
gfx::Rect window_bounds_in_pixels(
parent_bounds_in_pixels.x() +
(parent_bounds_in_pixels.width() - size_in_pixels.width()) / 2,
parent_bounds_in_pixels.y() +
(parent_bounds_in_pixels.height() - size_in_pixels.height()) / 2,
size_in_pixels.width(), size_in_pixels.height());
// Don't size the window bigger than the parent, otherwise the user may not be
// able to close or move it.
window_bounds_in_pixels.AdjustToFit(parent_bounds_in_pixels);
SetBoundsInPixels(window_bounds_in_pixels);
}
void DesktopWindowTreeHostX11::GetWindowPlacement( void DesktopWindowTreeHostX11::GetWindowPlacement(
gfx::Rect* bounds, gfx::Rect* bounds,
ui::WindowShowState* show_state) const { ui::WindowShowState* show_state) const {
...@@ -497,22 +453,6 @@ void DesktopWindowTreeHostX11::GetWindowPlacement( ...@@ -497,22 +453,6 @@ void DesktopWindowTreeHostX11::GetWindowPlacement(
} }
} }
gfx::Rect DesktopWindowTreeHostX11::GetWindowBoundsInScreen() const {
return ToDIPRect(GetBoundsInPixels());
}
gfx::Rect DesktopWindowTreeHostX11::GetClientAreaBoundsInScreen() const {
// TODO(erg): The NativeWidgetAura version returns |bounds_in_pixels_|,
// claiming it's needed for View::ConvertPointToScreen() to work correctly.
// DesktopWindowTreeHostWin::GetClientAreaBoundsInScreen() just asks windows
// what it thinks the client rect is.
//
// Attempts to calculate the rect by asking the NonClientFrameView what it
// thought its GetBoundsForClientView() were broke combobox drop down
// placement.
return GetWindowBoundsInScreen();
}
gfx::Rect DesktopWindowTreeHostX11::GetRestoredBounds() const { gfx::Rect DesktopWindowTreeHostX11::GetRestoredBounds() const {
// We can't reliably track the restored bounds of a window, but we can get // We can't reliably track the restored bounds of a window, but we can get
// the 90% case down. When *chrome* is the process that requests maximizing // the 90% case down. When *chrome* is the process that requests maximizing
...@@ -529,12 +469,6 @@ std::string DesktopWindowTreeHostX11::GetWorkspace() const { ...@@ -529,12 +469,6 @@ std::string DesktopWindowTreeHostX11::GetWorkspace() const {
return workspace ? base::NumberToString(workspace.value()) : std::string(); return workspace ? base::NumberToString(workspace.value()) : std::string();
} }
gfx::Rect DesktopWindowTreeHostX11::GetWorkAreaBoundsInScreen() const {
return display::Screen::GetScreen()
->GetDisplayNearestWindow(const_cast<aura::Window*>(window()))
.work_area();
}
void DesktopWindowTreeHostX11::SetShape( void DesktopWindowTreeHostX11::SetShape(
std::unique_ptr<Widget::ShapeRects> native_shape) { std::unique_ptr<Widget::ShapeRects> native_shape) {
_XRegion* xregion = nullptr; _XRegion* xregion = nullptr;
...@@ -560,15 +494,6 @@ void DesktopWindowTreeHostX11::SetShape( ...@@ -560,15 +494,6 @@ void DesktopWindowTreeHostX11::SetShape(
ResetWindowRegion(); ResetWindowRegion();
} }
void DesktopWindowTreeHostX11::Activate() {
GetXWindow()->Activate();
}
void DesktopWindowTreeHostX11::Deactivate() {
ReleaseCapture();
GetXWindow()->Deactivate();
}
bool DesktopWindowTreeHostX11::IsActive() const { bool DesktopWindowTreeHostX11::IsActive() const {
return GetXWindow()->IsActive(); return GetXWindow()->IsActive();
} }
...@@ -665,22 +590,6 @@ bool DesktopWindowTreeHostX11::IsVisibleOnAllWorkspaces() const { ...@@ -665,22 +590,6 @@ bool DesktopWindowTreeHostX11::IsVisibleOnAllWorkspaces() const {
return GetXWindow()->IsVisibleOnAllWorkspaces(); return GetXWindow()->IsVisibleOnAllWorkspaces();
} }
bool DesktopWindowTreeHostX11::SetWindowTitle(const base::string16& title) {
return GetXWindow()->SetTitle(title);
}
void DesktopWindowTreeHostX11::ClearNativeFocus() {
// This method is weird and misnamed. Instead of clearing the native focus,
// it sets the focus to our content_window(), which will trigger a cascade
// of focus changes into views.
if (content_window() && aura::client::GetFocusClient(content_window()) &&
content_window()->Contains(
aura::client::GetFocusClient(content_window())->GetFocusedWindow())) {
aura::client::GetFocusClient(content_window())
->FocusWindow(content_window());
}
}
Widget::MoveLoopResult DesktopWindowTreeHostX11::RunMoveLoop( Widget::MoveLoopResult DesktopWindowTreeHostX11::RunMoveLoop(
const gfx::Vector2d& drag_offset, const gfx::Vector2d& drag_offset,
Widget::MoveLoopSource source, Widget::MoveLoopSource source,
...@@ -705,12 +614,6 @@ void DesktopWindowTreeHostX11::SetVisibilityChangedAnimationsEnabled( ...@@ -705,12 +614,6 @@ void DesktopWindowTreeHostX11::SetVisibilityChangedAnimationsEnabled(
// Much like the previous NativeWidgetGtk, we don't have anything to do here. // Much like the previous NativeWidgetGtk, we don't have anything to do here.
} }
NonClientFrameView* DesktopWindowTreeHostX11::CreateNonClientFrameView() {
return ShouldUseNativeFrame()
? new NativeFrameView(native_widget_delegate()->AsWidget())
: nullptr;
}
bool DesktopWindowTreeHostX11::ShouldUseNativeFrame() const { bool DesktopWindowTreeHostX11::ShouldUseNativeFrame() const {
return GetXWindow()->use_native_frame(); return GetXWindow()->use_native_frame();
} }
...@@ -851,10 +754,6 @@ bool DesktopWindowTreeHostX11::ShouldCreateVisibilityController() const { ...@@ -851,10 +754,6 @@ bool DesktopWindowTreeHostX11::ShouldCreateVisibilityController() const {
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// DesktopWindowTreeHostX11, aura::WindowTreeHost implementatio // DesktopWindowTreeHostX11, aura::WindowTreeHost implementatio
ui::EventSource* DesktopWindowTreeHostX11::GetEventSource() {
return this;
}
void DesktopWindowTreeHostX11::ShowImpl() { void DesktopWindowTreeHostX11::ShowImpl() {
Show(ui::SHOW_STATE_NORMAL, gfx::Rect()); Show(ui::SHOW_STATE_NORMAL, gfx::Rect());
} }
...@@ -864,10 +763,6 @@ void DesktopWindowTreeHostX11::HideImpl() { ...@@ -864,10 +763,6 @@ void DesktopWindowTreeHostX11::HideImpl() {
SetVisible(false); SetVisible(false);
} }
gfx::Rect DesktopWindowTreeHostX11::GetBoundsInPixels() const {
return GetXWindow()->bounds();
}
void DesktopWindowTreeHostX11::SetBoundsInPixels( void DesktopWindowTreeHostX11::SetBoundsInPixels(
const gfx::Rect& requested_bounds_in_pixel) { const gfx::Rect& requested_bounds_in_pixel) {
gfx::Rect bounds = GetXWindow()->bounds(); gfx::Rect bounds = GetXWindow()->bounds();
...@@ -886,10 +781,6 @@ void DesktopWindowTreeHostX11::SetBoundsInPixels( ...@@ -886,10 +781,6 @@ void DesktopWindowTreeHostX11::SetBoundsInPixels(
platform_window()->SetBounds(bounds_in_pixels); platform_window()->SetBounds(bounds_in_pixels);
} }
gfx::Point DesktopWindowTreeHostX11::GetLocationOnScreenInPixels() const {
return GetXWindow()->bounds().origin();
}
void DesktopWindowTreeHostX11::SetCapture() { void DesktopWindowTreeHostX11::SetCapture() {
if (HasCapture()) if (HasCapture())
return; return;
...@@ -924,42 +815,6 @@ void DesktopWindowTreeHostX11::ReleaseCapture() { ...@@ -924,42 +815,6 @@ void DesktopWindowTreeHostX11::ReleaseCapture() {
} }
} }
bool DesktopWindowTreeHostX11::CaptureSystemKeyEventsImpl(
base::Optional<base::flat_set<ui::DomCode>> dom_codes) {
// Only one KeyboardHook should be active at a time, otherwise there will be
// problems with event routing (i.e. which Hook takes precedence) and
// destruction ordering.
DCHECK(!keyboard_hook_);
keyboard_hook_ = ui::KeyboardHook::CreateModifierKeyboardHook(
std::move(dom_codes), GetAcceleratedWidget(),
base::BindRepeating(&DesktopWindowTreeHostX11::DispatchKeyEvent,
base::Unretained(this)));
return keyboard_hook_ != nullptr;
}
void DesktopWindowTreeHostX11::ReleaseSystemKeyEventCapture() {
keyboard_hook_.reset();
}
bool DesktopWindowTreeHostX11::IsKeyLocked(ui::DomCode dom_code) {
return keyboard_hook_ && keyboard_hook_->IsKeyLocked(dom_code);
}
void DesktopWindowTreeHostX11::SetCursorNative(gfx::NativeCursor cursor) {
GetXWindow()->SetCursor(cursor.platform());
}
void DesktopWindowTreeHostX11::MoveCursorToScreenLocationInPixels(
const gfx::Point& location_in_pixels) {
GetXWindow()->MoveCursorTo(location_in_pixels);
}
void DesktopWindowTreeHostX11::OnCursorVisibilityChangedNative(bool show) {
// TODO(erg): Conditional on us enabling touch on desktop linux builds, do
// the same tap-to-click disabling here that chromeos does.
}
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// DesktopWindowTreeHostX11, display::DisplayObserver implementation: // DesktopWindowTreeHostX11, display::DisplayObserver implementation:
......
...@@ -34,7 +34,6 @@ class ImageSkia; ...@@ -34,7 +34,6 @@ class ImageSkia;
namespace ui { namespace ui {
enum class DomCode; enum class DomCode;
class KeyboardHook;
class KeyEvent; class KeyEvent;
class MouseEvent; class MouseEvent;
class TouchEvent; class TouchEvent;
...@@ -44,7 +43,6 @@ class X11Window; ...@@ -44,7 +43,6 @@ class X11Window;
namespace views { namespace views {
class DesktopDragDropClientAuraX11; class DesktopDragDropClientAuraX11;
class DesktopWindowTreeHostObserverX11; class DesktopWindowTreeHostObserverX11;
class NonClientFrameView;
class X11DesktopWindowMoveClient; class X11DesktopWindowMoveClient;
class WindowEventFilter; class WindowEventFilter;
...@@ -104,31 +102,21 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11 : public DesktopWindowTreeHostLinux, ...@@ -104,31 +102,21 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11 : public DesktopWindowTreeHostLinux,
// Overridden from DesktopWindowTreeHost: // Overridden from DesktopWindowTreeHost:
void Init(const Widget::InitParams& params) override; void Init(const Widget::InitParams& params) override;
void OnNativeWidgetCreated(const Widget::InitParams& params) override; void OnNativeWidgetCreated(const Widget::InitParams& params) override;
void OnWidgetInitDone() override;
void OnActiveWindowChanged(bool active) override;
std::unique_ptr<corewm::Tooltip> CreateTooltip() override;
std::unique_ptr<aura::client::DragDropClient> CreateDragDropClient( std::unique_ptr<aura::client::DragDropClient> CreateDragDropClient(
DesktopNativeCursorManager* cursor_manager) override; DesktopNativeCursorManager* cursor_manager) override;
void Close() override; void Close() override;
void CloseNow() override; void CloseNow() override;
aura::WindowTreeHost* AsWindowTreeHost() override;
void Show(ui::WindowShowState show_state, void Show(ui::WindowShowState show_state,
const gfx::Rect& restore_bounds) override; const gfx::Rect& restore_bounds) override;
bool IsVisible() const override; bool IsVisible() const override;
void SetSize(const gfx::Size& requested_size) override; void SetSize(const gfx::Size& requested_size) override;
void StackAbove(aura::Window* window) override; void StackAbove(aura::Window* window) override;
void StackAtTop() override; void StackAtTop() override;
void CenterWindow(const gfx::Size& size) override;
void GetWindowPlacement(gfx::Rect* bounds, void GetWindowPlacement(gfx::Rect* bounds,
ui::WindowShowState* show_state) const override; ui::WindowShowState* show_state) const override;
gfx::Rect GetWindowBoundsInScreen() const override;
gfx::Rect GetClientAreaBoundsInScreen() const override;
gfx::Rect GetRestoredBounds() const override; gfx::Rect GetRestoredBounds() const override;
std::string GetWorkspace() const override; std::string GetWorkspace() const override;
gfx::Rect GetWorkAreaBoundsInScreen() const override;
void SetShape(std::unique_ptr<Widget::ShapeRects> native_shape) override; void SetShape(std::unique_ptr<Widget::ShapeRects> native_shape) override;
void Activate() override;
void Deactivate() override;
bool IsActive() const override; bool IsActive() const override;
void Maximize() override; void Maximize() override;
void Minimize() override; void Minimize() override;
...@@ -140,15 +128,12 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11 : public DesktopWindowTreeHostLinux, ...@@ -140,15 +128,12 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11 : public DesktopWindowTreeHostLinux,
ui::ZOrderLevel GetZOrderLevel() const override; ui::ZOrderLevel GetZOrderLevel() const override;
void SetVisibleOnAllWorkspaces(bool always_visible) override; void SetVisibleOnAllWorkspaces(bool always_visible) override;
bool IsVisibleOnAllWorkspaces() const override; bool IsVisibleOnAllWorkspaces() const override;
bool SetWindowTitle(const base::string16& title) override;
void ClearNativeFocus() override;
Widget::MoveLoopResult RunMoveLoop( Widget::MoveLoopResult RunMoveLoop(
const gfx::Vector2d& drag_offset, const gfx::Vector2d& drag_offset,
Widget::MoveLoopSource source, Widget::MoveLoopSource source,
Widget::MoveLoopEscapeBehavior escape_behavior) override; Widget::MoveLoopEscapeBehavior escape_behavior) override;
void EndMoveLoop() override; void EndMoveLoop() override;
void SetVisibilityChangedAnimationsEnabled(bool value) override; void SetVisibilityChangedAnimationsEnabled(bool value) override;
NonClientFrameView* CreateNonClientFrameView() override;
bool ShouldUseNativeFrame() const override; bool ShouldUseNativeFrame() const override;
bool ShouldWindowContentsBeTransparent() const override; bool ShouldWindowContentsBeTransparent() const override;
void FrameTypeChanged() override; void FrameTypeChanged() override;
...@@ -168,22 +153,11 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11 : public DesktopWindowTreeHostLinux, ...@@ -168,22 +153,11 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11 : public DesktopWindowTreeHostLinux,
bool ShouldCreateVisibilityController() const override; bool ShouldCreateVisibilityController() const override;
// Overridden from aura::WindowTreeHost: // Overridden from aura::WindowTreeHost:
ui::EventSource* GetEventSource() override;
void ShowImpl() override; void ShowImpl() override;
void HideImpl() override; void HideImpl() override;
gfx::Rect GetBoundsInPixels() const override;
void SetBoundsInPixels(const gfx::Rect& requested_bounds_in_pixels) override; void SetBoundsInPixels(const gfx::Rect& requested_bounds_in_pixels) override;
gfx::Point GetLocationOnScreenInPixels() const override;
void SetCapture() override; void SetCapture() override;
void ReleaseCapture() override; void ReleaseCapture() override;
bool CaptureSystemKeyEventsImpl(
base::Optional<base::flat_set<ui::DomCode>> dom_codes) override;
void ReleaseSystemKeyEventCapture() override;
bool IsKeyLocked(ui::DomCode dom_code) override;
void SetCursorNative(gfx::NativeCursor cursor) override;
void MoveCursorToScreenLocationInPixels(
const gfx::Point& location_in_pixels) override;
void OnCursorVisibilityChangedNative(bool show) override;
// Overridden from display::DisplayObserver via aura::WindowTreeHost: // Overridden from display::DisplayObserver via aura::WindowTreeHost:
void OnDisplayMetricsChanged(const display::Display& display, void OnDisplayMetricsChanged(const display::Display& display,
...@@ -201,10 +175,6 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11 : public DesktopWindowTreeHostLinux, ...@@ -201,10 +175,6 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11 : public DesktopWindowTreeHostLinux,
int hittest, int hittest,
const gfx::Point& pointer_location) override; const gfx::Point& pointer_location) override;
// Creates an aura::WindowEventDispatcher to contain the content_window()
// along with all aura client objects that direct behavior.
aura::WindowEventDispatcher* InitDispatcher(const Widget::InitParams& params);
// Sets whether the window's borders are provided by the window manager. // Sets whether the window's borders are provided by the window manager.
void SetUseNativeFrame(bool use_native_frame); void SetUseNativeFrame(bool use_native_frame);
...@@ -309,9 +279,6 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11 : public DesktopWindowTreeHostLinux, ...@@ -309,9 +279,6 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11 : public DesktopWindowTreeHostLinux,
// Cached value for SetVisible. Not the same as the IsVisible public API. // Cached value for SetVisible. Not the same as the IsVisible public API.
bool is_compositor_set_visible_ = false; bool is_compositor_set_visible_ = false;
// Captures system key events when keyboard lock is requested.
std::unique_ptr<ui::KeyboardHook> keyboard_hook_;
std::unique_ptr<aura::ScopedWindowTargeter> targeter_for_modal_; std::unique_ptr<aura::ScopedWindowTargeter> targeter_for_modal_;
uint32_t modal_dialog_counter_ = 0; uint32_t modal_dialog_counter_ = 0;
......
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