Commit 3bccf529 authored by James Cook's avatar James Cook Committed by Commit Bot

Clean up MASH_DEPRECATED in shelf auto-hide code

I verified that autohide works properly under mash with mouse gestures,
touch gestures, and bezel gestures.

Bug: 636647, 631216
Test: ash_unittests, manual on device
Change-Id: I368a72a96dbac9791eb67ede9adc739e1d9079fb
Reviewed-on: https://chromium-review.googlesource.com/1134405Reviewed-by: default avatarMichael Wasserman <msw@chromium.org>
Commit-Queue: James Cook <jamescook@chromium.org>
Cr-Commit-Position: refs/heads/master@{#574433}
parent dc5161c7
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
#include <memory> #include <memory>
#include "ash/app_list/app_list_controller_impl.h" #include "ash/app_list/app_list_controller_impl.h"
#include "ash/public/cpp/config.h"
#include "ash/public/cpp/shelf_item_delegate.h" #include "ash/public/cpp/shelf_item_delegate.h"
#include "ash/public/cpp/shelf_model.h" #include "ash/public/cpp/shelf_model.h"
#include "ash/public/cpp/shell_window_ids.h" #include "ash/public/cpp/shell_window_ids.h"
...@@ -29,7 +28,6 @@ namespace ash { ...@@ -29,7 +28,6 @@ namespace ash {
// Shelf::AutoHideEventHandler ----------------------------------------------- // Shelf::AutoHideEventHandler -----------------------------------------------
// Forwards mouse and gesture events to ShelfLayoutManager for auto-hide. // Forwards mouse and gesture events to ShelfLayoutManager for auto-hide.
// TODO(mash): Add similar event handling support for mash.
class Shelf::AutoHideEventHandler : public ui::EventHandler { class Shelf::AutoHideEventHandler : public ui::EventHandler {
public: public:
explicit AutoHideEventHandler(ShelfLayoutManager* shelf_layout_manager) explicit AutoHideEventHandler(ShelfLayoutManager* shelf_layout_manager)
...@@ -57,12 +55,9 @@ class Shelf::AutoHideEventHandler : public ui::EventHandler { ...@@ -57,12 +55,9 @@ class Shelf::AutoHideEventHandler : public ui::EventHandler {
// Shelf --------------------------------------------------------------------- // Shelf ---------------------------------------------------------------------
Shelf::Shelf() : shelf_locking_manager_(this) { Shelf::Shelf()
// TODO: ShelfBezelEventHandler needs to work with mus too. : shelf_locking_manager_(this),
// http://crbug.com/636647 bezel_event_handler_(std::make_unique<ShelfBezelEventHandler>(this)) {}
if (Shell::GetAshConfig() != Config::MASH_DEPRECATED)
bezel_event_handler_ = std::make_unique<ShelfBezelEventHandler>(this);
}
Shelf::~Shelf() = default; Shelf::~Shelf() = default;
...@@ -348,8 +343,7 @@ void Shelf::WillChangeVisibilityState(ShelfVisibilityState new_state) { ...@@ -348,8 +343,7 @@ void Shelf::WillChangeVisibilityState(ShelfVisibilityState new_state) {
observer.WillChangeVisibilityState(new_state); observer.WillChangeVisibilityState(new_state);
if (new_state != SHELF_AUTO_HIDE) { if (new_state != SHELF_AUTO_HIDE) {
auto_hide_event_handler_.reset(); auto_hide_event_handler_.reset();
} else if (!auto_hide_event_handler_ && } else if (!auto_hide_event_handler_) {
Shell::GetAshConfig() != Config::MASH_DEPRECATED) {
auto_hide_event_handler_ = auto_hide_event_handler_ =
std::make_unique<AutoHideEventHandler>(shelf_layout_manager()); std::make_unique<AutoHideEventHandler>(shelf_layout_manager());
} }
......
...@@ -187,11 +187,9 @@ class ASH_EXPORT Shelf : public ShelfLayoutManagerObserver { ...@@ -187,11 +187,9 @@ class ASH_EXPORT Shelf : public ShelfLayoutManagerObserver {
base::ObserverList<ShelfObserver> observers_; base::ObserverList<ShelfObserver> observers_;
// Forwards mouse and gesture events to ShelfLayoutManager for auto-hide. // Forwards mouse and gesture events to ShelfLayoutManager for auto-hide.
// TODO(mash): Facilitate simliar functionality in mash: crbug.com/631216
std::unique_ptr<AutoHideEventHandler> auto_hide_event_handler_; std::unique_ptr<AutoHideEventHandler> auto_hide_event_handler_;
// Forwards touch gestures on a bezel sensor to the shelf. // Forwards touch gestures on a bezel sensor to the shelf.
// TODO(mash): Facilitate simliar functionality in mash: crbug.com/636647
std::unique_ptr<ShelfBezelEventHandler> bezel_event_handler_; std::unique_ptr<ShelfBezelEventHandler> bezel_event_handler_;
// True while the animation to enter or exit tablet mode is running. Sometimes // True while the animation to enter or exit tablet mode is running. Sometimes
......
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