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