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 #include "ash/shelf/shelf_util.h" | 5 #include "ash/shelf/shelf_util.h" |
6 | 6 |
7 #include "ash/shelf/shelf_constants.h" | 7 #include "ash/shelf/shelf_constants.h" |
8 #include "ui/aura/window_property.h" | 8 #include "ui/aura/window_property.h" |
9 | 9 |
10 DECLARE_WINDOW_PROPERTY_TYPE(ash::ShelfID); | 10 DECLARE_WINDOW_PROPERTY_TYPE(ash::ShelfID); |
11 DECLARE_WINDOW_PROPERTY_TYPE(ash::ShelfItemDetails*); | 11 DECLARE_WINDOW_PROPERTY_TYPE(ash::ShelfItemDetails*); |
12 | 12 |
13 namespace ash { | 13 namespace ash { |
14 | 14 |
15 DEFINE_LOCAL_WINDOW_PROPERTY_KEY(ShelfID, kShelfID, kInvalidShelfID); | 15 DEFINE_WINDOW_PROPERTY_KEY(ShelfID, kShelfID, kInvalidShelfID); |
16 | 16 |
17 // ShelfItemDetails for kShelfItemDetaildKey is owned by the window | 17 // ShelfItemDetails for kShelfItemDetaildKey is owned by the window |
18 // and will be freed automatically. | 18 // and will be freed automatically. |
19 DEFINE_OWNED_WINDOW_PROPERTY_KEY(ShelfItemDetails, | 19 DEFINE_OWNED_WINDOW_PROPERTY_KEY(ShelfItemDetails, |
20 kShelfItemDetailsKey, | 20 kShelfItemDetailsKey, |
21 NULL); | 21 NULL); |
22 | 22 |
23 void SetShelfIDForWindow(ShelfID id, aura::Window* window) { | 23 void SetShelfIDForWindow(ShelfID id, aura::Window* window) { |
24 if (!window) | 24 if (!window) |
25 return; | 25 return; |
(...skipping 16 matching lines...) Expand all Loading... |
42 void ClearShelfItemDetailsForWindow(aura::Window* window) { | 42 void ClearShelfItemDetailsForWindow(aura::Window* window) { |
43 window->ClearProperty(kShelfItemDetailsKey); | 43 window->ClearProperty(kShelfItemDetailsKey); |
44 } | 44 } |
45 | 45 |
46 const ShelfItemDetails* GetShelfItemDetailsForWindow( | 46 const ShelfItemDetails* GetShelfItemDetailsForWindow( |
47 aura::Window* window) { | 47 aura::Window* window) { |
48 return window->GetProperty(kShelfItemDetailsKey); | 48 return window->GetProperty(kShelfItemDetailsKey); |
49 } | 49 } |
50 | 50 |
51 } // namespace ash | 51 } // namespace ash |
OLD | NEW |