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

Unified Diff: ash/aura/wm_shelf_aura.cc

Issue 2626483002: Removes WmShelfAura and WmShelfMus (Closed)
Patch Set: merge Created 3 years, 11 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
« no previous file with comments | « ash/aura/wm_shelf_aura.h ('k') | ash/common/shelf/wm_shelf.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/aura/wm_shelf_aura.cc
diff --git a/ash/aura/wm_shelf_aura.cc b/ash/aura/wm_shelf_aura.cc
deleted file mode 100644
index 7feec5a600b066f80ebcbe6f7f417892b108ef26..0000000000000000000000000000000000000000
--- a/ash/aura/wm_shelf_aura.cc
+++ /dev/null
@@ -1,71 +0,0 @@
-// Copyright 2016 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "ash/aura/wm_shelf_aura.h"
-
-#include "ash/aura/wm_window_aura.h"
-#include "ash/common/shelf/shelf_layout_manager.h"
-#include "ash/shelf/shelf_bezel_event_handler.h"
-#include "ash/shell.h"
-
-namespace ash {
-
-// WmShelfAura::AutoHideEventHandler -------------------------------------------
-
-// Forwards mouse and gesture events to ShelfLayoutManager for auto-hide.
-// TODO(mash): Add similar event handling support for mash.
-class WmShelfAura::AutoHideEventHandler : public ui::EventHandler {
- public:
- explicit AutoHideEventHandler(ShelfLayoutManager* shelf_layout_manager)
- : shelf_layout_manager_(shelf_layout_manager) {
- Shell::GetInstance()->AddPreTargetHandler(this);
- }
- ~AutoHideEventHandler() override {
- Shell::GetInstance()->RemovePreTargetHandler(this);
- }
-
- // Overridden from ui::EventHandler:
- void OnMouseEvent(ui::MouseEvent* event) override {
- shelf_layout_manager_->UpdateAutoHideForMouseEvent(
- event, WmWindowAura::Get(static_cast<aura::Window*>(event->target())));
- }
- void OnGestureEvent(ui::GestureEvent* event) override {
- shelf_layout_manager_->UpdateAutoHideForGestureEvent(
- event, WmWindowAura::Get(static_cast<aura::Window*>(event->target())));
- }
-
- private:
- ShelfLayoutManager* shelf_layout_manager_;
- DISALLOW_COPY_AND_ASSIGN(AutoHideEventHandler);
-};
-
-// WmShelfAura -----------------------------------------------------------------
-
-WmShelfAura::WmShelfAura() {}
-
-WmShelfAura::~WmShelfAura() {}
-
-void WmShelfAura::CreateShelfWidget(WmWindow* root) {
- WmShelf::CreateShelfWidget(root);
- bezel_event_handler_.reset(new ShelfBezelEventHandler(this));
-}
-
-void WmShelfAura::WillDeleteShelfLayoutManager() {
- // Clear event handlers that might forward events to the destroyed instance.
- auto_hide_event_handler_.reset();
- bezel_event_handler_.reset();
- WmShelf::WillDeleteShelfLayoutManager();
-}
-
-void WmShelfAura::WillChangeVisibilityState(ShelfVisibilityState new_state) {
- WmShelf::WillChangeVisibilityState(new_state);
- if (new_state != SHELF_AUTO_HIDE) {
- auto_hide_event_handler_.reset();
- } else if (!auto_hide_event_handler_) {
- auto_hide_event_handler_.reset(
- new AutoHideEventHandler(shelf_layout_manager()));
- }
-}
-
-} // namespace ash
« no previous file with comments | « ash/aura/wm_shelf_aura.h ('k') | ash/common/shelf/wm_shelf.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698