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

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

Issue 2274333002: ash: Move more code from Shelf to WmShelf (Closed)
Patch Set: tweak 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/common/shelf/wm_shelf.h
diff --git a/ash/common/shelf/wm_shelf.h b/ash/common/shelf/wm_shelf.h
index 33f4450941b68fdb525cd4cee2329bfb93771373..3172c0bfe00750fe36521e64384c137d670439a6 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 LaunchAppAtIndex(int item_index);
msw 2016/08/25 00:22:24 nit: converge on (*AppAtIndex or *ShelfItem) and (
James Cook 2016/08/25 02:29:13 Done.
+
+ // Activates the shelf item specified by the index in the list of shelf items.
+ static void ActivateShelfItem(int 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.

Powered by Google App Engine
This is Rietveld 408576698