| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/launcher/launcher_util.h" | 5 #include "ash/launcher/launcher_util.h" |
| 6 | 6 |
| 7 #include "ash/launcher/launcher_model.h" | 7 #include "ash/launcher/launcher_model.h" |
| 8 #include "ash/launcher/launcher_types.h" | |
| 9 | 8 |
| 10 namespace ash { | 9 namespace ash { |
| 11 namespace launcher { | 10 namespace launcher { |
| 12 | 11 |
| 13 int GetBrowserItemIndex(const LauncherModel& launcher_model) { | 12 int GetBrowserItemIndex(const LauncherModel& launcher_model) { |
| 14 for (size_t i = 0; i < launcher_model.items().size(); i++) { | 13 for (size_t i = 0; i < launcher_model.items().size(); i++) { |
| 15 if (launcher_model.items()[i].type == ash::TYPE_BROWSER_SHORTCUT) | 14 if (launcher_model.items()[i].type == ash::TYPE_BROWSER_SHORTCUT) |
| 16 return i; | 15 return i; |
| 17 } | 16 } |
| 18 return -1; | 17 return -1; |
| 19 } | 18 } |
| 20 | 19 |
| 20 ash::LauncherID GetBrowserItemID(const LauncherModel& launcher_model) { |
| 21 for (size_t i = 0; i < launcher_model.items().size(); i++) { |
| 22 if (launcher_model.items()[i].type == ash::TYPE_BROWSER_SHORTCUT) |
| 23 return launcher_model.items()[i].id; |
| 24 } |
| 25 return 0; |
| 26 } |
| 27 |
| 28 ash::LauncherID GetAppListItemID(const LauncherModel& launcher_model) { |
| 29 for (size_t i = 0; i < launcher_model.items().size(); i++) { |
| 30 if (launcher_model.items()[i].type == ash::TYPE_APP_LIST) |
| 31 return launcher_model.items()[i].id; |
| 32 } |
| 33 return 0; |
| 34 } |
| 35 |
| 21 } // namespace launcher | 36 } // namespace launcher |
| 22 } // namespace ash | 37 } // namespace ash |
| OLD | NEW |