Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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. | |
| 4 | |
| 5 #ifndef ASH_SHELF_SHELF_UTIL_H_ | |
| 6 #define ASH_SHELF_SHELF_UTIL_H_ | |
| 7 | |
| 8 #include "ash/ash_export.h" | |
| 9 #include "ash/common/shelf/shelf_item_types.h" | |
| 10 #include "ash/common/shelf/shelf_types.h" | |
| 11 #include "base/strings/string16.h" | |
| 12 #include "ui/aura/window.h" | |
| 13 | |
| 14 namespace aura { | |
| 15 class Window; | |
| 16 } | |
| 17 | |
| 18 namespace ash { | |
| 19 | |
| 20 // A property key to store the id of the ShelfItem associated with the window. | |
| 21 extern const aura::WindowProperty<ShelfID>* const kShelfID; | |
| 22 | |
| 23 // A property key to store the resource id and title of the item shown on the | |
| 24 // shelf for this window. | |
| 25 extern const aura::WindowProperty<ShelfItemDetails*>* const | |
| 26 kShelfItemDetailsKey; | |
| 27 | |
| 28 // Associates ShelfItem of |id| with specified |window|. | |
| 29 ASH_EXPORT void SetShelfIDForWindow(ShelfID id, aura::Window* window); | |
| 30 | |
| 31 // Returns the id of the ShelfItem associated with the specified |window|, | |
| 32 // or 0 if there isn't one. | |
| 33 // Note: Window of a tabbed browser will return the |ShelfID| of the | |
| 34 // currently active tab. | |
| 35 ASH_EXPORT ShelfID GetShelfIDForWindow(const aura::Window* window); | |
| 36 | |
| 37 // Creates a new ShelfItemDetails instance from |details| and sets it for | |
| 38 // |window|. | |
| 39 ASH_EXPORT void SetShelfItemDetailsForWindow(aura::Window* window, | |
|
James Cook
2016/09/14 22:07:10
I'm so glad all these bare functions are gone.
msw
2016/09/14 22:29:14
Acknowledged.
| |
| 40 const ShelfItemDetails& details); | |
| 41 | |
| 42 // Creates a new ShelfItemDetails instance with type DIALOG, image id | |
| 43 // |image_resource_id|, and title |title|, and sets it for |window|. | |
| 44 ASH_EXPORT void SetShelfItemDetailsForDialogWindow(aura::Window* window, | |
| 45 int image_resource_id, | |
| 46 const base::string16& title); | |
| 47 | |
| 48 // Clears ShelfItemDetails for |window|. | |
| 49 // If |window| has a ShelfItem by SetShelfItemDetailsForWindow(), it will | |
| 50 // be removed. | |
| 51 ASH_EXPORT void ClearShelfItemDetailsForWindow(aura::Window* window); | |
| 52 | |
| 53 // Returns ShelfItemDetails for |window| or NULL if it doesn't have. | |
| 54 // Returned ShelfItemDetails object is owned by the |window|. | |
| 55 ASH_EXPORT const ShelfItemDetails* GetShelfItemDetailsForWindow( | |
| 56 aura::Window* window); | |
| 57 | |
| 58 } // namespace ash | |
| 59 | |
| 60 #endif // ASH_SHELF_SHELF_UTIL_H_ | |
| OLD | NEW |