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

Side by Side Diff: ash/common/shelf/shelf_model.cc

Issue 2046513003: mash: Move shelf model and item classes to ash/common/shelf (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@initshelfearly
Patch Set: Created 4 years, 6 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/common/shelf/shelf_model.h ('k') | ash/common/shelf/shelf_model_observer.h » ('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_model.h" 5 #include "ash/common/shelf/shelf_model.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "ash/ash_switches.h" 9 #include "ash/common/shelf/shelf_model_observer.h"
10 #include "ash/shelf/shelf_model_observer.h"
11 10
12 namespace ash { 11 namespace ash {
13 12
14 namespace { 13 namespace {
15 14
16 int ShelfItemTypeToWeight(ShelfItemType type) { 15 int ShelfItemTypeToWeight(ShelfItemType type) {
17 switch (type) { 16 switch (type) {
18 case TYPE_APP_LIST: 17 case TYPE_APP_LIST:
19 // TODO(skuhne): If the app list item becomes movable again, this need 18 // TODO(skuhne): If the app list item becomes movable again, this need
20 // to be a fallthrough. 19 // to be a fallthrough.
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 CompareByWeight) - items_.begin(), 169 CompareByWeight) - items_.begin(),
171 static_cast<ShelfItems::difference_type>(index)); 170 static_cast<ShelfItems::difference_type>(index));
172 index = std::min(std::upper_bound(items_.begin(), items_.end(), weight_dummy, 171 index = std::min(std::upper_bound(items_.begin(), items_.end(), weight_dummy,
173 CompareByWeight) - items_.begin(), 172 CompareByWeight) - items_.begin(),
174 static_cast<ShelfItems::difference_type>(index)); 173 static_cast<ShelfItems::difference_type>(index));
175 174
176 return index; 175 return index;
177 } 176 }
178 177
179 } // namespace ash 178 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/shelf/shelf_model.h ('k') | ash/common/shelf/shelf_model_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698