Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(278)

Unified Diff: ash/aura/wm_shelf_aura.cc

Issue 2237613002: mash: Migrate some misc ShelfLayoutManager deps to ash common. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move ShelfBezelEventHandler to WmShelfAura. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ash/aura/wm_shelf_aura.cc
diff --git a/ash/aura/wm_shelf_aura.cc b/ash/aura/wm_shelf_aura.cc
index 25e60bb97e701f4870688b49844fa1b4b872f018..43f758ebc2a20bf70ea366231c430f2552e16439 100644
--- a/ash/aura/wm_shelf_aura.cc
+++ b/ash/aura/wm_shelf_aura.cc
@@ -9,6 +9,7 @@
#include "ash/common/wm_window.h"
#include "ash/shelf/dimmer_view.h"
#include "ash/shelf/shelf.h"
+#include "ash/shelf/shelf_bezel_event_handler.h"
#include "ash/shelf/shelf_layout_manager.h"
#include "ash/shell.h"
#include "ui/views/widget/widget.h"
@@ -55,6 +56,7 @@ void WmShelfAura::SetShelfLayoutManager(
DCHECK(!shelf_layout_manager_);
shelf_layout_manager_ = shelf_layout_manager;
shelf_layout_manager_->AddObserver(this);
+ bezel_event_handler_.reset(new ShelfBezelEventHandler(this));
}
void WmShelfAura::SetShelf(Shelf* shelf) {
@@ -80,7 +82,9 @@ Shelf* WmShelfAura::GetShelf(WmShelf* shelf) {
void WmShelfAura::ResetShelfLayoutManager() {
if (!shelf_layout_manager_)
return;
+ // Clear event handlers that might otherwise forward events during shutdown.
auto_hide_event_handler_.reset();
+ bezel_event_handler_.reset();
shelf_layout_manager_->RemoveObserver(this);
shelf_layout_manager_ = nullptr;
}

Powered by Google App Engine
This is Rietveld 408576698