Chromium Code Reviews| 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 "ui/aura/window_property.h" | 7 #include "ui/aura/window_property.h" |
| 8 | 8 |
| 9 DECLARE_WINDOW_PROPERTY_TYPE(ash::LauncherID); | 9 DECLARE_WINDOW_PROPERTY_TYPE(ash::LauncherID); |
| 10 DECLARE_WINDOW_PROPERTY_TYPE(ash::LauncherItemDetails*); | 10 DECLARE_WINDOW_PROPERTY_TYPE(ash::LauncherItemDetails*); |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 24 return; | 24 return; |
| 25 | 25 |
| 26 window->SetProperty(kLauncherID, id); | 26 window->SetProperty(kLauncherID, id); |
| 27 } | 27 } |
| 28 | 28 |
| 29 LauncherID GetLauncherIDForWindow(aura::Window* window) { | 29 LauncherID GetLauncherIDForWindow(aura::Window* window) { |
| 30 DCHECK(window); | 30 DCHECK(window); |
| 31 return window->GetProperty(kLauncherID); | 31 return window->GetProperty(kLauncherID); |
| 32 } | 32 } |
| 33 | 33 |
| 34 void SetLauncherItemDetailsForWindow(aura::Window* window, | 34 void SetShelfItemDetailsForWindow(aura::Window* window, |
| 35 const LauncherItemDetails& details) { | 35 const LauncherItemDetails& details) { |
|
James Cook
2013/12/16 23:34:52
nit: indent
tfarina
2013/12/17 00:45:24
Done.
| |
| 36 // |item_details| is owned by |window|. | 36 // |item_details| is owned by |window|. |
| 37 LauncherItemDetails* item_details = new LauncherItemDetails(details); | 37 LauncherItemDetails* item_details = new LauncherItemDetails(details); |
| 38 window->SetProperty(kLauncherItemDetailsKey, item_details); | 38 window->SetProperty(kLauncherItemDetailsKey, item_details); |
| 39 } | 39 } |
| 40 | 40 |
| 41 void ClearLauncherItemDetailsForWindow(aura::Window* window) { | 41 void ClearLauncherItemDetailsForWindow(aura::Window* window) { |
| 42 window->ClearProperty(kLauncherItemDetailsKey); | 42 window->ClearProperty(kLauncherItemDetailsKey); |
| 43 } | 43 } |
| 44 | 44 |
| 45 const LauncherItemDetails* GetLauncherItemDetailsForWindow( | 45 const LauncherItemDetails* GetLauncherItemDetailsForWindow( |
| 46 aura::Window* window) { | 46 aura::Window* window) { |
| 47 return window->GetProperty(kLauncherItemDetailsKey); | 47 return window->GetProperty(kLauncherItemDetailsKey); |
| 48 } | 48 } |
| 49 | 49 |
| 50 } // namespace ash | 50 } // namespace ash |
| OLD | NEW |