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

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

Issue 2627533002: Replace ShelfItemDelegate::GetTitle() with ShelfItem::title. (Closed)
Patch Set: Address comments. Created 3 years, 11 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_view.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/common/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/common/shelf/shelf_item_delegate.h" 9 #include "ash/common/shelf/shelf_item_delegate.h"
10 #include "ash/common/shelf/shelf_model_observer.h" 10 #include "ash/common/shelf/shelf_model_observer.h"
(...skipping 25 matching lines...) Expand all
36 NOTREACHED() << "Invalid type " << type; 36 NOTREACHED() << "Invalid type " << type;
37 return 1; 37 return 1;
38 } 38 }
39 39
40 bool CompareByWeight(const ShelfItem& a, const ShelfItem& b) { 40 bool CompareByWeight(const ShelfItem& a, const ShelfItem& b) {
41 return ShelfItemTypeToWeight(a.type) < ShelfItemTypeToWeight(b.type); 41 return ShelfItemTypeToWeight(a.type) < ShelfItemTypeToWeight(b.type);
42 } 42 }
43 43
44 } // namespace 44 } // namespace
45 45
46 ShelfModel::ShelfModel() : next_id_(1), status_(STATUS_NORMAL) {} 46 ShelfModel::ShelfModel() : next_id_(1) {}
47 47
48 ShelfModel::~ShelfModel() {} 48 ShelfModel::~ShelfModel() {}
49 49
50 void ShelfModel::DestroyItemDelegates() { 50 void ShelfModel::DestroyItemDelegates() {
51 // Some ShelfItemDelegates access this model in their destructors and hence 51 // Some ShelfItemDelegates access this model in their destructors and hence
52 // need early cleanup. 52 // need early cleanup.
53 id_to_item_delegate_map_.clear(); 53 id_to_item_delegate_map_.clear();
54 } 54 }
55 55
56 int ShelfModel::Add(const ShelfItem& item) { 56 int ShelfModel::Add(const ShelfItem& item) {
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 202
203 return index; 203 return index;
204 } 204 }
205 205
206 void ShelfModel::RemoveShelfItemDelegate(ShelfID id) { 206 void ShelfModel::RemoveShelfItemDelegate(ShelfID id) {
207 if (id_to_item_delegate_map_.find(id) != id_to_item_delegate_map_.end()) 207 if (id_to_item_delegate_map_.find(id) != id_to_item_delegate_map_.end())
208 id_to_item_delegate_map_.erase(id); 208 id_to_item_delegate_map_.erase(id);
209 } 209 }
210 210
211 } // namespace ash 211 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/shelf/shelf_model.h ('k') | ash/common/shelf/shelf_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698