From 2b4d20515a62a16c12be5fd30be3a40a630a1e2c Mon Sep 17 00:00:00 2001 From: "tfarina@chromium.org" Date: Fri, 1 Nov 2013 16:58:53 +0000 Subject: 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 --- ash/shelf/shelf_model_util.cc | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 ash/shelf/shelf_model_util.cc (limited to 'ash/shelf/shelf_model_util.cc') 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 -- cgit v1.1