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

Unified Diff: ash/shelf/shelf_window_targeter.h

Issue 2209803004: mash: Move ShelfWindowTargeter out of shelf_widget.cc (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments. 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
« no previous file with comments | « ash/shelf/shelf_widget.cc ('k') | ash/shelf/shelf_window_targeter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/shelf/shelf_window_targeter.h
diff --git a/ash/shelf/shelf_window_targeter.h b/ash/shelf/shelf_window_targeter.h
new file mode 100644
index 0000000000000000000000000000000000000000..390bd512bb5f55bb8c33ce1c7f88b4bb398aa3ce
--- /dev/null
+++ b/ash/shelf/shelf_window_targeter.h
@@ -0,0 +1,41 @@
+// 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.
+
+#ifndef ASH_SHELF_SHELF_WINDOW_TARGETER_H_
+#define ASH_SHELF_SHELF_WINDOW_TARGETER_H_
+
+#include "ash/common/shelf/wm_shelf_observer.h"
+#include "ash/common/wm_window_observer.h"
+#include "base/macros.h"
+#include "ui/wm/core/easy_resize_window_targeter.h"
+
+namespace ash {
+
+class WmShelf;
+
+// ShelfWindowTargeter makes it easier to resize windows with the mouse when the
+// window-edge slightly overlaps with the shelf edge. The targeter also makes it
+// easier to drag the shelf out with touch while it is hidden.
+class ShelfWindowTargeter : public ::wm::EasyResizeWindowTargeter,
+ public WmWindowObserver,
+ public WmShelfObserver {
+ public:
+ ShelfWindowTargeter(WmWindow* container, WmShelf* shelf);
+ ~ShelfWindowTargeter() override;
+
+ private:
+ // WmWindowObserver:
+ void OnWindowDestroying(WmWindow* window) override;
+
+ // WmShelfObserver:
+ void WillChangeVisibilityState(ShelfVisibilityState new_state) override;
+
+ WmShelf* shelf_;
+
+ DISALLOW_COPY_AND_ASSIGN(ShelfWindowTargeter);
+};
+
+} // namespace ash
+
+#endif // ASH_SHELF_SHELF_WINDOW_TARGETER_H_
« no previous file with comments | « ash/shelf/shelf_widget.cc ('k') | ash/shelf/shelf_window_targeter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698