OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef ASH_SHELF_SHELF_UTIL_H_ | 5 #ifndef ASH_SHELF_SHELF_UTIL_H_ |
6 #define ASH_SHELF_SHELF_UTIL_H_ | 6 #define ASH_SHELF_SHELF_UTIL_H_ |
7 | 7 |
8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
9 #include "ash/shelf/shelf_item_types.h" | 9 #include "ash/shelf/shelf_item_types.h" |
10 #include "ui/aura/window.h" | 10 #include "ui/aura/window.h" |
11 | 11 |
12 namespace aura { | 12 namespace aura { |
13 class Window; | 13 class Window; |
14 } | 14 } |
15 | 15 |
16 namespace ash { | 16 namespace ash { |
17 | 17 |
18 extern const aura::WindowProperty<ShelfID>* const kShelfID; | |
sky
2014/04/22 16:06:13
Add description.
flackr
2014/04/22 17:30:38
Done.
| |
19 | |
18 extern const aura::WindowProperty<ShelfItemDetails*>* const | 20 extern const aura::WindowProperty<ShelfItemDetails*>* const |
19 kShelfItemDetailsKey; | 21 kShelfItemDetailsKey; |
20 | 22 |
21 // Associates ShelfItem of |id| with specified |window|. | 23 // Associates ShelfItem of |id| with specified |window|. |
22 ASH_EXPORT void SetShelfIDForWindow(ShelfID id, aura::Window* window); | 24 ASH_EXPORT void SetShelfIDForWindow(ShelfID id, aura::Window* window); |
23 | 25 |
24 // Returns the id of the ShelfItem associated with the specified |window|, | 26 // Returns the id of the ShelfItem associated with the specified |window|, |
25 // or 0 if there isn't one. | 27 // or 0 if there isn't one. |
26 // Note: Window of a tabbed browser will return the |ShelfID| of the | 28 // Note: Window of a tabbed browser will return the |ShelfID| of the |
27 // currently active tab. | 29 // currently active tab. |
28 ASH_EXPORT ShelfID GetShelfIDForWindow(aura::Window* window); | 30 ASH_EXPORT ShelfID GetShelfIDForWindow(aura::Window* window); |
29 | 31 |
30 // Sets ShelfItemDetails for |window|. | 32 // Sets ShelfItemDetails for |window|. |
31 ASH_EXPORT void SetShelfItemDetailsForWindow(aura::Window* window, | 33 ASH_EXPORT void SetShelfItemDetailsForWindow(aura::Window* window, |
32 const ShelfItemDetails& details); | 34 const ShelfItemDetails& details); |
33 | 35 |
34 // Clears ShelfItemDetails for |window|. | 36 // Clears ShelfItemDetails for |window|. |
35 // If |window| has a ShelfItem by SetShelfItemDetailsForWindow(), it will | 37 // If |window| has a ShelfItem by SetShelfItemDetailsForWindow(), it will |
36 // be removed. | 38 // be removed. |
37 ASH_EXPORT void ClearShelfItemDetailsForWindow(aura::Window* window); | 39 ASH_EXPORT void ClearShelfItemDetailsForWindow(aura::Window* window); |
38 | 40 |
39 // Returns ShelfItemDetails for |window| or NULL if it doesn't have. | 41 // Returns ShelfItemDetails for |window| or NULL if it doesn't have. |
40 // Returned ShelfItemDetails object is owned by the |window|. | 42 // Returned ShelfItemDetails object is owned by the |window|. |
41 ASH_EXPORT const ShelfItemDetails* GetShelfItemDetailsForWindow( | 43 ASH_EXPORT const ShelfItemDetails* GetShelfItemDetailsForWindow( |
42 aura::Window* window); | 44 aura::Window* window); |
43 | 45 |
44 } // namespace ash | 46 } // namespace ash |
45 | 47 |
46 #endif // ASH_SHELF_SHELF_UTIL_H_ | 48 #endif // ASH_SHELF_SHELF_UTIL_H_ |
OLD | NEW |