Commit 9db56d73 authored by James Cook's avatar James Cook Committed by Commit Bot

chromeos: Remove factory methods from ash::ShellPort

We no longer have mash vs. classic configs in ash, and there's only one
implementation of ShellPort. As a step towards eliminating ShellPort,
remove the object factory methods from it.

Keep CreatePointerWatcherAdapter for now because that will require
more general PointerWatcher cleanup.

Bug: 866523
Test: ash_unittests
Change-Id: Iff2c3898932389ebc7eeb253ca4eb046da35e641
Reviewed-on: https://chromium-review.googlesource.com/1157688
Commit-Queue: James Cook <jamescook@chromium.org>
Reviewed-by: default avatarMichael Wasserman <msw@chromium.org>
Cr-Commit-Position: refs/heads/master@{#579683}
parent a5d5bb89
...@@ -45,6 +45,7 @@ ASH_EXPORT extern const char kFullscreenMagnifierToggleAccelNotificationId[]; ...@@ -45,6 +45,7 @@ ASH_EXPORT extern const char kFullscreenMagnifierToggleAccelNotificationId[];
class ASH_EXPORT AcceleratorController : public ui::AcceleratorTarget, class ASH_EXPORT AcceleratorController : public ui::AcceleratorTarget,
public mojom::AcceleratorController { public mojom::AcceleratorController {
public: public:
// TODO(jamescook): Remove |manager_delegate|. https://crbug.com/842365
explicit AcceleratorController( explicit AcceleratorController(
ui::AcceleratorManagerDelegate* manager_delegate); ui::AcceleratorManagerDelegate* manager_delegate);
~AcceleratorController() override; ~AcceleratorController() override;
......
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
#include "ash/host/ash_window_tree_host_platform.h" #include "ash/host/ash_window_tree_host_platform.h"
#include "ash/host/ash_window_tree_host_unified.h" #include "ash/host/ash_window_tree_host_unified.h"
#include "ash/public/cpp/ash_switches.h" #include "ash/public/cpp/ash_switches.h"
#include "ash/shell_port.h"
#include "base/command_line.h" #include "base/command_line.h"
#include "base/sys_info.h" #include "base/sys_info.h"
#include "ui/aura/client/screen_position_client.h" #include "ui/aura/client/screen_position_client.h"
...@@ -72,11 +71,6 @@ void AshWindowTreeHost::TranslateLocatedEvent(ui::LocatedEvent* event) { ...@@ -72,11 +71,6 @@ void AshWindowTreeHost::TranslateLocatedEvent(ui::LocatedEvent* event) {
// static // static
std::unique_ptr<AshWindowTreeHost> AshWindowTreeHost::Create( std::unique_ptr<AshWindowTreeHost> AshWindowTreeHost::Create(
const AshWindowTreeHostInitParams& init_params) { const AshWindowTreeHostInitParams& init_params) {
std::unique_ptr<AshWindowTreeHost> ash_window_tree_host =
ShellPort::Get()->CreateAshWindowTreeHost(init_params);
if (ash_window_tree_host)
return ash_window_tree_host;
if (init_params.mirroring_unified) { if (init_params.mirroring_unified) {
return std::make_unique<AshWindowTreeHostMirroringUnified>( return std::make_unique<AshWindowTreeHostMirroringUnified>(
init_params.initial_bounds, init_params.display_id, init_params.initial_bounds, init_params.display_id,
......
...@@ -207,6 +207,7 @@ ...@@ -207,6 +207,7 @@
#include "ui/keyboard/keyboard_switches.h" #include "ui/keyboard/keyboard_switches.h"
#include "ui/keyboard/keyboard_ui.h" #include "ui/keyboard/keyboard_ui.h"
#include "ui/keyboard/keyboard_util.h" #include "ui/keyboard/keyboard_util.h"
#include "ui/ozone/public/ozone_platform.h"
#include "ui/views/corewm/tooltip_aura.h" #include "ui/views/corewm/tooltip_aura.h"
#include "ui/views/corewm/tooltip_controller.h" #include "ui/views/corewm/tooltip_controller.h"
#include "ui/views/focus/focus_manager_factory.h" #include "ui/views/focus/focus_manager_factory.h"
...@@ -1083,7 +1084,7 @@ void Shell::Init( ...@@ -1083,7 +1084,7 @@ void Shell::Init(
cursor_manager_->SetDisplay( cursor_manager_->SetDisplay(
display::Screen::GetScreen()->GetPrimaryDisplay()); display::Screen::GetScreen()->GetPrimaryDisplay());
accelerator_controller_ = shell_port_->CreateAcceleratorController(); accelerator_controller_ = std::make_unique<AcceleratorController>(nullptr);
// |app_list_controller_| is put after |tablet_mode_controller_| as the former // |app_list_controller_| is put after |tablet_mode_controller_| as the former
// uses the latter in constructor. // uses the latter in constructor.
...@@ -1224,9 +1225,9 @@ void Shell::Init( ...@@ -1224,9 +1225,9 @@ void Shell::Init(
// WindowTreeHostManager::Observer::OnDisplaysInitialized(). // WindowTreeHostManager::Observer::OnDisplaysInitialized().
touch_transformer_controller_ = std::make_unique<AshTouchTransformController>( touch_transformer_controller_ = std::make_unique<AshTouchTransformController>(
display_configurator_.get(), display_manager_.get(), display_configurator_.get(), display_manager_.get(),
shell_port_->CreateTouchTransformDelegate()); std::make_unique<display::DefaultTouchTransformSetter>());
keyboard_ui_ = shell_port_->CreateKeyboardUI(); keyboard_ui_ = KeyboardUI::Create();
// |system_tray_model_| should be available before // |system_tray_model_| should be available before
// |system_notification_controller_| is initialized and Shelf is created by // |system_notification_controller_| is initialized and Shelf is created by
...@@ -1313,8 +1314,8 @@ void Shell::InitializeDisplayManager() { ...@@ -1313,8 +1314,8 @@ void Shell::InitializeDisplayManager() {
display_configuration_controller_ = display_configuration_controller_ =
std::make_unique<DisplayConfigurationController>( std::make_unique<DisplayConfigurationController>(
display_manager_.get(), window_tree_host_manager_.get()); display_manager_.get(), window_tree_host_manager_.get());
display_configurator_->Init(shell_port_->CreateNativeDisplayDelegate(), display_configurator_->Init(
false); ui::OzonePlatform::GetInstance()->CreateNativeDisplayDelegate(), false);
display_configuration_observer_ = display_configuration_observer_ =
std::make_unique<DisplayConfigurationObserver>(); std::make_unique<DisplayConfigurationObserver>();
......
...@@ -15,15 +15,6 @@ ...@@ -15,15 +15,6 @@
#include "ui/aura/client/window_types.h" #include "ui/aura/client/window_types.h"
#include "ui/base/ui_base_types.h" #include "ui/base/ui_base_types.h"
namespace aura {
class Window;
}
namespace display {
class NativeDisplayDelegate;
class TouchTransformSetter;
}
namespace gfx { namespace gfx {
class Point; class Point;
} }
...@@ -34,25 +25,14 @@ enum class PointerWatcherEventTypes; ...@@ -34,25 +25,14 @@ enum class PointerWatcherEventTypes;
} }
namespace ash { namespace ash {
class AcceleratorController;
class AshWindowTreeHost;
struct AshWindowTreeHostInitParams;
class KeyboardUI;
class RootWindowController; class RootWindowController;
class WindowCycleEventFilter;
class WindowResizer;
class WorkspaceEventHandler;
enum class Config; enum class Config;
enum class TaskSwitchSource;
namespace wm {
class TabletModeEventHandler;
class WindowState;
}
// Porting layer for Shell. This class contains the part of Shell that are // Porting layer for Shell. This class contains the part of Shell that are
// different in classic ash and mus/mash. // different in classic ash and mus/mash.
// DEPRECATED: Being removed, since there is no longer a distinct "classic"
// config in ash. See https://crbug.com/866523
class ASH_EXPORT ShellPort { class ASH_EXPORT ShellPort {
public: public:
virtual ~ShellPort(); virtual ~ShellPort();
...@@ -64,34 +44,10 @@ class ASH_EXPORT ShellPort { ...@@ -64,34 +44,10 @@ class ASH_EXPORT ShellPort {
virtual Config GetAshConfig() const = 0; virtual Config GetAshConfig() const = 0;
// The return value from this is supplied to AshTouchTransformController; see
// it and TouchTransformSetter for details.
virtual std::unique_ptr<display::TouchTransformSetter>
CreateTouchTransformDelegate() = 0;
// Shows the context menu for the wallpaper or shelf at |location_in_screen|. // Shows the context menu for the wallpaper or shelf at |location_in_screen|.
void ShowContextMenu(const gfx::Point& location_in_screen, void ShowContextMenu(const gfx::Point& location_in_screen,
ui::MenuSourceType source_type); ui::MenuSourceType source_type);
// Returns a WindowResizer to handle dragging. |next_window_resizer| is
// the next WindowResizer in the WindowResizer chain. This may return
// |next_window_resizer|.
virtual std::unique_ptr<WindowResizer> CreateDragWindowResizer(
std::unique_ptr<WindowResizer> next_window_resizer,
wm::WindowState* window_state) = 0;
virtual std::unique_ptr<WindowCycleEventFilter>
CreateWindowCycleEventFilter() = 0;
virtual std::unique_ptr<wm::TabletModeEventHandler>
CreateTabletModeEventHandler() = 0;
virtual std::unique_ptr<WorkspaceEventHandler> CreateWorkspaceEventHandler(
aura::Window* workspace_window) = 0;
// Creates the KeyboardUI. This is called early on.
virtual std::unique_ptr<KeyboardUI> CreateKeyboardUI() = 0;
// If |events| is PointerWatcherEventTypes::MOVES, // If |events| is PointerWatcherEventTypes::MOVES,
// PointerWatcher::OnPointerEventObserved() is called for pointer move events. // PointerWatcher::OnPointerEventObserved() is called for pointer move events.
// If |events| is PointerWatcherEventTypes::DRAGS, // If |events| is PointerWatcherEventTypes::DRAGS,
...@@ -110,11 +66,6 @@ class ASH_EXPORT ShellPort { ...@@ -110,11 +66,6 @@ class ASH_EXPORT ShellPort {
virtual void CreatePointerWatcherAdapter() = 0; virtual void CreatePointerWatcherAdapter() = 0;
// Creates an AshWindowTreeHost. A return value of null results in a platform
// specific AshWindowTreeHost being created.
virtual std::unique_ptr<AshWindowTreeHost> CreateAshWindowTreeHost(
const AshWindowTreeHostInitParams& init_params) = 0;
// Called after the containers of |root_window_controller| have been created. // Called after the containers of |root_window_controller| have been created.
// Allows ShellPort to install any additional state on the containers. // Allows ShellPort to install any additional state on the containers.
virtual void OnCreatedRootWindowContainers( virtual void OnCreatedRootWindowContainers(
...@@ -134,15 +85,7 @@ class ASH_EXPORT ShellPort { ...@@ -134,15 +85,7 @@ class ASH_EXPORT ShellPort {
// Called after WindowTreeHostManager::InitHosts(). // Called after WindowTreeHostManager::InitHosts().
virtual void OnHostsInitialized() = 0; virtual void OnHostsInitialized() = 0;
virtual std::unique_ptr<display::NativeDisplayDelegate>
CreateNativeDisplayDelegate() = 0;
// Called during startup to create the AcceleratorController.
virtual std::unique_ptr<AcceleratorController>
CreateAcceleratorController() = 0;
private: private:
friend class AcceleratorControllerTest;
friend class Shell; friend class Shell;
static ShellPort* instance_; static ShellPort* instance_;
......
...@@ -7,29 +7,12 @@ ...@@ -7,29 +7,12 @@
#include <memory> #include <memory>
#include <utility> #include <utility>
#include "ash/accelerators/accelerator_controller.h"
#include "ash/host/ash_window_tree_host.h"
#include "ash/host/ash_window_tree_host_init_params.h"
#include "ash/keyboard/keyboard_ui.h"
#include "ash/keyboard/virtual_keyboard_controller.h" #include "ash/keyboard/virtual_keyboard_controller.h"
#include "ash/pointer_watcher_adapter_classic.h" #include "ash/pointer_watcher_adapter_classic.h"
#include "ash/public/cpp/config.h" #include "ash/public/cpp/config.h"
#include "ash/public/cpp/immersive/immersive_fullscreen_controller.h"
#include "ash/shell.h" #include "ash/shell.h"
#include "ash/wm/drag_window_resizer.h"
#include "ash/wm/mru_window_tracker.h"
#include "ash/wm/overview/window_selector_controller.h"
#include "ash/wm/tablet_mode/scoped_disable_internal_mouse_and_keyboard.h"
#include "ash/wm/tablet_mode/tablet_mode_event_handler_classic.h"
#include "ash/wm/window_cycle_event_filter_classic.h"
#include "ash/wm/window_util.h"
#include "ash/wm/workspace/workspace_event_handler_classic.h"
#include "base/memory/ptr_util.h"
#include "components/viz/host/host_frame_sink_manager.h" #include "components/viz/host/host_frame_sink_manager.h"
#include "ui/aura/env.h" #include "ui/aura/env.h"
#include "ui/display/manager/default_touch_transform_setter.h"
#include "ui/display/types/native_display_delegate.h"
#include "ui/ozone/public/ozone_platform.h"
namespace ash { namespace ash {
...@@ -53,37 +36,6 @@ Config ShellPortClassic::GetAshConfig() const { ...@@ -53,37 +36,6 @@ Config ShellPortClassic::GetAshConfig() const {
return Config::CLASSIC; return Config::CLASSIC;
} }
std::unique_ptr<display::TouchTransformSetter>
ShellPortClassic::CreateTouchTransformDelegate() {
return std::make_unique<display::DefaultTouchTransformSetter>();
}
std::unique_ptr<WindowResizer> ShellPortClassic::CreateDragWindowResizer(
std::unique_ptr<WindowResizer> next_window_resizer,
wm::WindowState* window_state) {
return base::WrapUnique(
DragWindowResizer::Create(next_window_resizer.release(), window_state));
}
std::unique_ptr<WindowCycleEventFilter>
ShellPortClassic::CreateWindowCycleEventFilter() {
return std::make_unique<WindowCycleEventFilterClassic>();
}
std::unique_ptr<wm::TabletModeEventHandler>
ShellPortClassic::CreateTabletModeEventHandler() {
return std::make_unique<wm::TabletModeEventHandlerClassic>();
}
std::unique_ptr<WorkspaceEventHandler>
ShellPortClassic::CreateWorkspaceEventHandler(aura::Window* workspace_window) {
return std::make_unique<WorkspaceEventHandlerClassic>(workspace_window);
}
std::unique_ptr<KeyboardUI> ShellPortClassic::CreateKeyboardUI() {
return KeyboardUI::Create();
}
void ShellPortClassic::AddPointerWatcher( void ShellPortClassic::AddPointerWatcher(
views::PointerWatcher* watcher, views::PointerWatcher* watcher,
views::PointerWatcherEventTypes events) { views::PointerWatcherEventTypes events) {
...@@ -106,12 +58,6 @@ void ShellPortClassic::CreatePointerWatcherAdapter() { ...@@ -106,12 +58,6 @@ void ShellPortClassic::CreatePointerWatcherAdapter() {
pointer_watcher_adapter_ = std::make_unique<PointerWatcherAdapterClassic>(); pointer_watcher_adapter_ = std::make_unique<PointerWatcherAdapterClassic>();
} }
std::unique_ptr<AshWindowTreeHost> ShellPortClassic::CreateAshWindowTreeHost(
const AshWindowTreeHostInitParams& init_params) {
// A return value of null results in falling back to the default.
return nullptr;
}
void ShellPortClassic::OnCreatedRootWindowContainers( void ShellPortClassic::OnCreatedRootWindowContainers(
RootWindowController* root_window_controller) {} RootWindowController* root_window_controller) {}
...@@ -119,16 +65,6 @@ void ShellPortClassic::UpdateSystemModalAndBlockingContainers() {} ...@@ -119,16 +65,6 @@ void ShellPortClassic::UpdateSystemModalAndBlockingContainers() {}
void ShellPortClassic::OnHostsInitialized() {} void ShellPortClassic::OnHostsInitialized() {}
std::unique_ptr<display::NativeDisplayDelegate>
ShellPortClassic::CreateNativeDisplayDelegate() {
return ui::OzonePlatform::GetInstance()->CreateNativeDisplayDelegate();
}
std::unique_ptr<AcceleratorController>
ShellPortClassic::CreateAcceleratorController() {
return std::make_unique<AcceleratorController>(nullptr);
}
void ShellPortClassic::AddVideoDetectorObserver( void ShellPortClassic::AddVideoDetectorObserver(
viz::mojom::VideoDetectorObserverPtr observer) { viz::mojom::VideoDetectorObserverPtr observer) {
aura::Env::GetInstance() aura::Env::GetInstance()
......
...@@ -18,6 +18,8 @@ class PointerWatcherAdapterClassic; ...@@ -18,6 +18,8 @@ class PointerWatcherAdapterClassic;
// Implementation of ShellPort for classic ash/aura. See ash/README.md for more // Implementation of ShellPort for classic ash/aura. See ash/README.md for more
// details. // details.
// DEPRECATED: Being removed, since there is no longer a distinct "classic"
// config in ash. See https://crbug.com/866523
class ASH_EXPORT ShellPortClassic : public ShellPort { class ASH_EXPORT ShellPortClassic : public ShellPort {
public: public:
ShellPortClassic(); ShellPortClassic();
...@@ -28,33 +30,16 @@ class ASH_EXPORT ShellPortClassic : public ShellPort { ...@@ -28,33 +30,16 @@ class ASH_EXPORT ShellPortClassic : public ShellPort {
// ShellPort: // ShellPort:
void Shutdown() override; void Shutdown() override;
Config GetAshConfig() const override; Config GetAshConfig() const override;
std::unique_ptr<display::TouchTransformSetter> CreateTouchTransformDelegate()
override;
std::unique_ptr<WindowResizer> CreateDragWindowResizer(
std::unique_ptr<WindowResizer> next_window_resizer,
wm::WindowState* window_state) override;
std::unique_ptr<WindowCycleEventFilter> CreateWindowCycleEventFilter()
override;
std::unique_ptr<wm::TabletModeEventHandler> CreateTabletModeEventHandler()
override;
std::unique_ptr<WorkspaceEventHandler> CreateWorkspaceEventHandler(
aura::Window* workspace_window) override;
std::unique_ptr<KeyboardUI> CreateKeyboardUI() override;
void AddPointerWatcher(views::PointerWatcher* watcher, void AddPointerWatcher(views::PointerWatcher* watcher,
views::PointerWatcherEventTypes events) override; views::PointerWatcherEventTypes events) override;
void RemovePointerWatcher(views::PointerWatcher* watcher) override; void RemovePointerWatcher(views::PointerWatcher* watcher) override;
bool IsTouchDown() override; bool IsTouchDown() override;
void ToggleIgnoreExternalKeyboard() override; void ToggleIgnoreExternalKeyboard() override;
void CreatePointerWatcherAdapter() override; void CreatePointerWatcherAdapter() override;
std::unique_ptr<AshWindowTreeHost> CreateAshWindowTreeHost(
const AshWindowTreeHostInitParams& init_params) override;
void OnCreatedRootWindowContainers( void OnCreatedRootWindowContainers(
RootWindowController* root_window_controller) override; RootWindowController* root_window_controller) override;
void UpdateSystemModalAndBlockingContainers() override; void UpdateSystemModalAndBlockingContainers() override;
void OnHostsInitialized() override; void OnHostsInitialized() override;
std::unique_ptr<display::NativeDisplayDelegate> CreateNativeDisplayDelegate()
override;
std::unique_ptr<AcceleratorController> CreateAcceleratorController() override;
void AddVideoDetectorObserver( void AddVideoDetectorObserver(
viz::mojom::VideoDetectorObserverPtr observer) override; viz::mojom::VideoDetectorObserverPtr observer) override;
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
#include "ash/wm/drag_window_resizer.h" #include "ash/wm/drag_window_resizer.h"
#include <utility>
#include "ash/display/mouse_cursor_event_filter.h" #include "ash/display/mouse_cursor_event_filter.h"
#include "ash/shell.h" #include "ash/shell.h"
#include "ash/wm/drag_window_controller.h" #include "ash/wm/drag_window_controller.h"
...@@ -48,12 +50,6 @@ DragWindowResizer::~DragWindowResizer() { ...@@ -48,12 +50,6 @@ DragWindowResizer::~DragWindowResizer() {
instance_ = NULL; instance_ = NULL;
} }
// static
DragWindowResizer* DragWindowResizer::Create(WindowResizer* next_window_resizer,
wm::WindowState* window_state) {
return new DragWindowResizer(next_window_resizer, window_state);
}
void DragWindowResizer::Drag(const gfx::Point& location, int event_flags) { void DragWindowResizer::Drag(const gfx::Point& location, int event_flags) {
base::WeakPtr<DragWindowResizer> resizer(weak_ptr_factory_.GetWeakPtr()); base::WeakPtr<DragWindowResizer> resizer(weak_ptr_factory_.GetWeakPtr());
next_window_resizer_->Drag(location, event_flags); next_window_resizer_->Drag(location, event_flags);
...@@ -129,10 +125,11 @@ void DragWindowResizer::RevertDrag() { ...@@ -129,10 +125,11 @@ void DragWindowResizer::RevertDrag() {
GetTarget()->layer()->SetOpacity(details().initial_opacity); GetTarget()->layer()->SetOpacity(details().initial_opacity);
} }
DragWindowResizer::DragWindowResizer(WindowResizer* next_window_resizer, DragWindowResizer::DragWindowResizer(
wm::WindowState* window_state) std::unique_ptr<WindowResizer> next_window_resizer,
wm::WindowState* window_state)
: WindowResizer(window_state), : WindowResizer(window_state),
next_window_resizer_(next_window_resizer), next_window_resizer_(std::move(next_window_resizer)),
weak_ptr_factory_(this) { weak_ptr_factory_(this) {
// The pointer should be confined in one display during resizing a window // The pointer should be confined in one display during resizing a window
// because the window cannot span two displays at the same time anyway. The // because the window cannot span two displays at the same time anyway. The
......
...@@ -23,14 +23,12 @@ class DragWindowController; ...@@ -23,14 +23,12 @@ class DragWindowController;
// drag windows across displays. // drag windows across displays.
class ASH_EXPORT DragWindowResizer : public WindowResizer { class ASH_EXPORT DragWindowResizer : public WindowResizer {
public: public:
// Creates DragWindowResizer that adds the ability of dragging windows across
// displays to |next_window_resizer|.
DragWindowResizer(std::unique_ptr<WindowResizer> next_window_resizer,
wm::WindowState* window_state);
~DragWindowResizer() override; ~DragWindowResizer() override;
// Creates a new DragWindowResizer. The caller takes ownership of the
// returned object. The ownership of |next_window_resizer| is taken by the
// returned object. Returns NULL if not resizable.
static DragWindowResizer* Create(WindowResizer* next_window_resizer,
wm::WindowState* window_state);
// WindowResizer: // WindowResizer:
void Drag(const gfx::Point& location, int event_flags) override; void Drag(const gfx::Point& location, int event_flags) override;
void CompleteDrag() override; void CompleteDrag() override;
...@@ -44,11 +42,6 @@ class ASH_EXPORT DragWindowResizer : public WindowResizer { ...@@ -44,11 +42,6 @@ class ASH_EXPORT DragWindowResizer : public WindowResizer {
FRIEND_TEST_ALL_PREFIXES(DragWindowResizerTest, DragWindowController); FRIEND_TEST_ALL_PREFIXES(DragWindowResizerTest, DragWindowController);
FRIEND_TEST_ALL_PREFIXES(DragWindowResizerTest, FRIEND_TEST_ALL_PREFIXES(DragWindowResizerTest,
DragWindowControllerAcrossThreeDisplays); DragWindowControllerAcrossThreeDisplays);
// Creates DragWindowResizer that adds the ability of dragging windows across
// displays to |next_window_resizer|. This object takes the ownership of
// |next_window_resizer|.
explicit DragWindowResizer(WindowResizer* next_window_resizer,
wm::WindowState* window_state);
// Updates the bounds of the drag window for window dragging. // Updates the bounds of the drag window for window dragging.
void UpdateDragWindow(const gfx::Rect& bounds_in_parent, void UpdateDragWindow(const gfx::Rect& bounds_in_parent,
......
...@@ -13,6 +13,8 @@ namespace ash { ...@@ -13,6 +13,8 @@ namespace ash {
namespace wm { namespace wm {
// Implementation of TabletModeEventHandler for aura. Uses ui::EventHandler. // Implementation of TabletModeEventHandler for aura. Uses ui::EventHandler.
// TODO(jamescook): Collapse with TabletModeEventHandler.
// https://crbug.com/866523
class ASH_EXPORT TabletModeEventHandlerClassic : public TabletModeEventHandler, class ASH_EXPORT TabletModeEventHandlerClassic : public TabletModeEventHandler,
public ui::EventHandler { public ui::EventHandler {
public: public:
......
...@@ -10,12 +10,11 @@ ...@@ -10,12 +10,11 @@
#include "ash/public/cpp/shell_window_ids.h" #include "ash/public/cpp/shell_window_ids.h"
#include "ash/root_window_controller.h" #include "ash/root_window_controller.h"
#include "ash/shell.h" #include "ash/shell.h"
#include "ash/shell_port.h"
#include "ash/wm/mru_window_tracker.h" #include "ash/wm/mru_window_tracker.h"
#include "ash/wm/overview/window_selector_controller.h" #include "ash/wm/overview/window_selector_controller.h"
#include "ash/wm/tablet_mode/scoped_skip_user_session_blocked_check.h" #include "ash/wm/tablet_mode/scoped_skip_user_session_blocked_check.h"
#include "ash/wm/tablet_mode/tablet_mode_backdrop_delegate_impl.h" #include "ash/wm/tablet_mode/tablet_mode_backdrop_delegate_impl.h"
#include "ash/wm/tablet_mode/tablet_mode_event_handler.h" #include "ash/wm/tablet_mode/tablet_mode_event_handler_classic.h"
#include "ash/wm/tablet_mode/tablet_mode_window_state.h" #include "ash/wm/tablet_mode/tablet_mode_window_state.h"
#include "ash/wm/window_state.h" #include "ash/wm/window_state.h"
#include "ash/wm/wm_event.h" #include "ash/wm/wm_event.h"
...@@ -249,7 +248,7 @@ TabletModeWindowManager::TabletModeWindowManager() { ...@@ -249,7 +248,7 @@ TabletModeWindowManager::TabletModeWindowManager() {
display::Screen::GetScreen()->AddObserver(this); display::Screen::GetScreen()->AddObserver(this);
Shell::Get()->AddShellObserver(this); Shell::Get()->AddShellObserver(this);
Shell::Get()->split_view_controller()->AddObserver(this); Shell::Get()->split_view_controller()->AddObserver(this);
event_handler_ = ShellPort::Get()->CreateTabletModeEventHandler(); event_handler_ = std::make_unique<wm::TabletModeEventHandlerClassic>();
} }
void TabletModeWindowManager::MaximizeAllWindows() { void TabletModeWindowManager::MaximizeAllWindows() {
......
...@@ -10,10 +10,9 @@ ...@@ -10,10 +10,9 @@
#include "ash/public/cpp/shell_window_ids.h" #include "ash/public/cpp/shell_window_ids.h"
#include "ash/session/session_controller.h" #include "ash/session/session_controller.h"
#include "ash/shell.h" #include "ash/shell.h"
#include "ash/shell_port.h"
#include "ash/wm/mru_window_tracker.h" #include "ash/wm/mru_window_tracker.h"
#include "ash/wm/screen_pinning_controller.h" #include "ash/wm/screen_pinning_controller.h"
#include "ash/wm/window_cycle_event_filter.h" #include "ash/wm/window_cycle_event_filter_classic.h"
#include "ash/wm/window_cycle_list.h" #include "ash/wm/window_cycle_list.h"
#include "base/metrics/histogram_macros.h" #include "base/metrics/histogram_macros.h"
#include "base/metrics/user_metrics.h" #include "base/metrics/user_metrics.h"
...@@ -62,7 +61,7 @@ void WindowCycleController::StartCycling() { ...@@ -62,7 +61,7 @@ void WindowCycleController::StartCycling() {
active_window_before_window_cycle_ = GetActiveWindow(window_list); active_window_before_window_cycle_ = GetActiveWindow(window_list);
window_cycle_list_.reset(new WindowCycleList(window_list)); window_cycle_list_.reset(new WindowCycleList(window_list));
event_filter_ = ShellPort::Get()->CreateWindowCycleEventFilter(); event_filter_ = std::make_unique<WindowCycleEventFilterClassic>();
cycle_start_time_ = base::Time::Now(); cycle_start_time_ = base::Time::Now();
base::RecordAction(base::UserMetricsAction("WindowCycleController_Cycle")); base::RecordAction(base::UserMetricsAction("WindowCycleController_Cycle"));
UMA_HISTOGRAM_COUNTS_100("Ash.WindowCycleController.Items", UMA_HISTOGRAM_COUNTS_100("Ash.WindowCycleController.Items",
......
...@@ -13,6 +13,8 @@ ...@@ -13,6 +13,8 @@
namespace ash { namespace ash {
// TODO(jamescook): Collapse with WindowCycleEventFilter.
// https://crbug.com/866523
class ASH_EXPORT WindowCycleEventFilterClassic : public ui::EventHandler, class ASH_EXPORT WindowCycleEventFilterClassic : public ui::EventHandler,
public WindowCycleEventFilter { public WindowCycleEventFilter {
public: public:
......
...@@ -14,8 +14,8 @@ ...@@ -14,8 +14,8 @@
#include "ash/root_window_controller.h" #include "ash/root_window_controller.h"
#include "ash/screen_util.h" #include "ash/screen_util.h"
#include "ash/shell.h" #include "ash/shell.h"
#include "ash/shell_port.h"
#include "ash/wm/default_window_resizer.h" #include "ash/wm/default_window_resizer.h"
#include "ash/wm/drag_window_resizer.h"
#include "ash/wm/panels/panel_window_resizer.h" #include "ash/wm/panels/panel_window_resizer.h"
#include "ash/wm/tablet_mode/tablet_mode_browser_window_drag_controller.h" #include "ash/wm/tablet_mode/tablet_mode_browser_window_drag_controller.h"
#include "ash/wm/tablet_mode/tablet_mode_controller.h" #include "ash/wm/tablet_mode/tablet_mode_controller.h"
...@@ -76,7 +76,7 @@ std::unique_ptr<WindowResizer> CreateWindowResizer( ...@@ -76,7 +76,7 @@ std::unique_ptr<WindowResizer> CreateWindowResizer(
window_state->CreateDragDetails(point_in_parent, window_component, source); window_state->CreateDragDetails(point_in_parent, window_component, source);
window_resizer = window_resizer =
std::make_unique<TabletModeBrowserWindowDragController>(window_state); std::make_unique<TabletModeBrowserWindowDragController>(window_state);
window_resizer = ShellPort::Get()->CreateDragWindowResizer( window_resizer = std::make_unique<DragWindowResizer>(
std::move(window_resizer), window_state); std::move(window_resizer), window_state);
return window_resizer; return window_resizer;
} }
...@@ -101,7 +101,7 @@ std::unique_ptr<WindowResizer> CreateWindowResizer( ...@@ -101,7 +101,7 @@ std::unique_ptr<WindowResizer> CreateWindowResizer(
} else { } else {
window_resizer.reset(DefaultWindowResizer::Create(window_state)); window_resizer.reset(DefaultWindowResizer::Create(window_state));
} }
window_resizer = ShellPort::Get()->CreateDragWindowResizer( window_resizer = std::make_unique<DragWindowResizer>(
std::move(window_resizer), window_state); std::move(window_resizer), window_state);
if (window->type() == aura::client::WINDOW_TYPE_PANEL) { if (window->type() == aura::client::WINDOW_TYPE_PANEL) {
window_resizer.reset( window_resizer.reset(
......
...@@ -10,14 +10,13 @@ ...@@ -10,14 +10,13 @@
#include "ash/root_window_controller.h" #include "ash/root_window_controller.h"
#include "ash/shelf/shelf.h" #include "ash/shelf/shelf.h"
#include "ash/shell.h" #include "ash/shell.h"
#include "ash/shell_port.h"
#include "ash/wm/fullscreen_window_finder.h" #include "ash/wm/fullscreen_window_finder.h"
#include "ash/wm/mru_window_tracker.h" #include "ash/wm/mru_window_tracker.h"
#include "ash/wm/window_state.h" #include "ash/wm/window_state.h"
#include "ash/wm/wm_window_animations.h" #include "ash/wm/wm_window_animations.h"
#include "ash/wm/workspace/backdrop_controller.h" #include "ash/wm/workspace/backdrop_controller.h"
#include "ash/wm/workspace/backdrop_delegate.h" #include "ash/wm/workspace/backdrop_delegate.h"
#include "ash/wm/workspace/workspace_event_handler.h" #include "ash/wm/workspace/workspace_event_handler_classic.h"
#include "ash/wm/workspace/workspace_layout_manager.h" #include "ash/wm/workspace/workspace_layout_manager.h"
#include "ui/aura/window.h" #include "ui/aura/window.h"
#include "ui/compositor/layer.h" #include "ui/compositor/layer.h"
...@@ -38,7 +37,7 @@ const int kInitialAnimationDurationMS = 200; ...@@ -38,7 +37,7 @@ const int kInitialAnimationDurationMS = 200;
WorkspaceController::WorkspaceController(aura::Window* viewport) WorkspaceController::WorkspaceController(aura::Window* viewport)
: viewport_(viewport), : viewport_(viewport),
event_handler_(ShellPort::Get()->CreateWorkspaceEventHandler(viewport)), event_handler_(std::make_unique<WorkspaceEventHandlerClassic>(viewport)),
layout_manager_(new WorkspaceLayoutManager(viewport)) { layout_manager_(new WorkspaceLayoutManager(viewport)) {
viewport_->AddObserver(this); viewport_->AddObserver(this);
::wm::SetWindowVisibilityAnimationTransition(viewport_, ::wm::ANIMATE_NONE); ::wm::SetWindowVisibilityAnimationTransition(viewport_, ::wm::ANIMATE_NONE);
......
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