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

Unified Diff: ash/common/shelf/wm_shelf.h

Issue 2274333002: ash: Move more code from Shelf to WmShelf (Closed)
Patch Set: review 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/common/shelf/shelf_widget.cc ('k') | ash/common/shelf/wm_shelf.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/shelf/wm_shelf.h
diff --git a/ash/common/shelf/wm_shelf.h b/ash/common/shelf/wm_shelf.h
index 33f4450941b68fdb525cd4cee2329bfb93771373..6f5a64f3b50eb0b07c9b1971eef005f745c173d7 100644
--- a/ash/common/shelf/wm_shelf.h
+++ b/ash/common/shelf/wm_shelf.h
@@ -36,6 +36,10 @@ class WmWindow;
// controller. Note that the shelf widget may not be created until after login.
class ASH_EXPORT WmShelf : public ShelfLayoutManagerObserver {
public:
+ // Returns the shelf for the display that |window| is on. Note that the shelf
+ // widget may not exist, or the shelf may not be visible.
+ static WmShelf* ForWindow(WmWindow* window);
+
void SetShelf(Shelf* shelf);
void ClearShelf();
Shelf* shelf() const { return shelf_; }
@@ -99,12 +103,21 @@ class ASH_EXPORT WmShelf : public ShelfLayoutManagerObserver {
gfx::Rect GetUserWorkAreaBounds() const;
- void UpdateIconPositionForWindow(WmWindow* window);
+ // Updates the icon position given the current window bounds. This is used
+ // when dragging panels to reposition them with respect to the other panels.
+ void UpdateIconPositionForPanel(WmWindow* window);
// Returns the screen bounds of the item for the specified window. If there is
// no item for the specified window an empty rect is returned.
gfx::Rect GetScreenBoundsOfItemIconForWindow(WmWindow* window);
+ // Launch a 0-indexed shelf item in the shelf. A negative index launches the
+ // last shelf item in the shelf.
+ static void LaunchShelfItem(int item_index);
+
+ // Activates the shelf item specified by the index in the list of shelf items.
+ static void ActivateShelfItem(int item_index);
+
// Handles a gesture |event| coming from a source outside the shelf widget
// (e.g. the status area widget). Allows support for behaviors like toggling
// auto-hide with a swipe, even if that gesture event hits another window.
« no previous file with comments | « ash/common/shelf/shelf_widget.cc ('k') | ash/common/shelf/wm_shelf.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698