1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef ASH_SHELF_SHELF_UTIL_H_
6 #define ASH_SHELF_SHELF_UTIL_H_
8 #include "ash/ash_export.h"
9 #include "ash/shelf/shelf_item_types.h"
10 #include "ui/aura/window.h"
18 // A property key to store the id of the ShelfItem associated with the window.
19 extern const aura::WindowProperty
<ShelfID
>* const kShelfID
;
21 // A property key to store the resource id and title of the item shown on the
22 // shelf for this window.
23 extern const aura::WindowProperty
<ShelfItemDetails
*>* const
26 // Associates ShelfItem of |id| with specified |window|.
27 ASH_EXPORT
void SetShelfIDForWindow(ShelfID id
, aura::Window
* window
);
29 // Returns the id of the ShelfItem associated with the specified |window|,
30 // or 0 if there isn't one.
31 // Note: Window of a tabbed browser will return the |ShelfID| of the
32 // currently active tab.
33 ASH_EXPORT ShelfID
GetShelfIDForWindow(aura::Window
* window
);
35 // Sets ShelfItemDetails for |window|.
36 ASH_EXPORT
void SetShelfItemDetailsForWindow(aura::Window
* window
,
37 const ShelfItemDetails
& details
);
39 // Clears ShelfItemDetails for |window|.
40 // If |window| has a ShelfItem by SetShelfItemDetailsForWindow(), it will
42 ASH_EXPORT
void ClearShelfItemDetailsForWindow(aura::Window
* window
);
44 // Returns ShelfItemDetails for |window| or NULL if it doesn't have.
45 // Returned ShelfItemDetails object is owned by the |window|.
46 ASH_EXPORT
const ShelfItemDetails
* GetShelfItemDetailsForWindow(
47 aura::Window
* window
);
51 #endif // ASH_SHELF_SHELF_UTIL_H_