Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(356)

Side by Side Diff: ash/shelf/shelf_util.cc

Issue 27369004: Change GetBrowserItemIndex() to GetLauncherItemIndexForType() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ash/shelf/shelf_util.h ('k') | ash/shell.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/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 10
12 int GetBrowserItemIndex(const LauncherModel& launcher_model) { 11 int GetLauncherItemIndexForType(LauncherItemType type,
12 const LauncherModel& launcher_model) {
13 DCHECK(type == TYPE_BROWSER_SHORTCUT || type == TYPE_APP_LIST);
sky 2013/10/22 20:05:17 Why does the type need to be one of these?
simonhong_ 2013/10/22 20:22:35 Because other types can have many items. Do we nee
13 for (size_t i = 0; i < launcher_model.items().size(); i++) { 14 for (size_t i = 0; i < launcher_model.items().size(); i++) {
14 if (launcher_model.items()[i].type == ash::TYPE_BROWSER_SHORTCUT) 15 if (launcher_model.items()[i].type == type)
15 return i; 16 return i;
16 } 17 }
17 return -1; 18 return -1;
18 } 19 }
19 20
20 } // namespace ash 21 } // namespace ash
OLDNEW
« no previous file with comments | « ash/shelf/shelf_util.h ('k') | ash/shell.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698