summaryrefslogtreecommitdiffstats
path: root/ash/shelf/shelf_model_util.cc
diff options
context:
space:
mode:
authortfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-01 16:58:53 +0000
committertfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-01 16:58:53 +0000
commit2b4d20515a62a16c12be5fd30be3a40a630a1e2c (patch)
tree0b9692acb5f751013880606f97dac13e9d2abaf7 /ash/shelf/shelf_model_util.cc
parenta18a7ebb718206f6242ad81f4446414ba75bc6c2 (diff)
downloadchromium_src-2b4d20515a62a16c12be5fd30be3a40a630a1e2c.zip
chromium_src-2b4d20515a62a16c12be5fd30be3a40a630a1e2c.tar.gz
chromium_src-2b4d20515a62a16c12be5fd30be3a40a630a1e2c.tar.bz2
ash: Rename GetLauncherItemIndexForType to GetShelfItemIndexForType().
- move launcher_model_util.* from launcher/ to shelf/ - rename to shelf_model_util.* BUG=248353 TEST=None, no functional changes R=harrym@chromium.org,jamescook@chromium.org Review URL: https://codereview.chromium.org/53513003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@232415 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/shelf/shelf_model_util.cc')
-rw-r--r--ash/shelf/shelf_model_util.cc20
1 files changed, 20 insertions, 0 deletions
diff --git a/ash/shelf/shelf_model_util.cc b/ash/shelf/shelf_model_util.cc
new file mode 100644
index 0000000..c4debdc
--- /dev/null
+++ b/ash/shelf/shelf_model_util.cc
@@ -0,0 +1,20 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ash/shelf/shelf_model_util.h"
+
+#include "ash/launcher/launcher_model.h"
+
+namespace ash {
+
+int GetShelfItemIndexForType(LauncherItemType type,
+ const LauncherModel& launcher_model) {
+ for (size_t i = 0; i < launcher_model.items().size(); i++) {
+ if (launcher_model.items()[i].type == type)
+ return i;
+ }
+ return -1;
+}
+
+} // namespace ash