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

Unified Diff: ash/common/shelf/shelf_model.cc

Issue 2095193002: clang-format all of //ash (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/common/shelf/shelf_item_types.cc ('k') | ash/common/shelf/shelf_model_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/shelf/shelf_model.cc
diff --git a/ash/common/shelf/shelf_model.cc b/ash/common/shelf/shelf_model.cc
index a8094707245bfd76e1cf81da2db7fa91330a2947..7577aec266401e04729694051979798bf839a5cd 100644
--- a/ash/common/shelf/shelf_model.cc
+++ b/ash/common/shelf/shelf_model.cc
@@ -45,11 +45,9 @@ bool CompareByWeight(const ShelfItem& a, const ShelfItem& b) {
} // namespace
-ShelfModel::ShelfModel() : next_id_(1), status_(STATUS_NORMAL) {
-}
+ShelfModel::ShelfModel() : next_id_(1), status_(STATUS_NORMAL) {}
-ShelfModel::~ShelfModel() {
-}
+ShelfModel::~ShelfModel() {}
int ShelfModel::Add(const ShelfItem& item) {
return AddAt(items_.size(), item);
@@ -87,8 +85,9 @@ void ShelfModel::Move(int index, int target_index) {
void ShelfModel::Set(int index, const ShelfItem& item) {
DCHECK(index >= 0 && index < item_count());
- int new_index = item.type == items_[index].type ?
- index : ValidateInsertionIndex(item.type, index);
+ int new_index = item.type == items_[index].type
+ ? index
+ : ValidateInsertionIndex(item.type, index);
ShelfItem old_item(items_[index]);
items_[index] = item;
@@ -125,8 +124,7 @@ int ShelfModel::GetItemIndexForType(ShelfItemType type) {
}
ShelfItems::const_iterator ShelfModel::ItemByID(int id) const {
- for (ShelfItems::const_iterator i = items_.begin();
- i != items_.end(); ++i) {
+ for (ShelfItems::const_iterator i = items_.begin(); i != items_.end(); ++i) {
if (i->id == id)
return i;
}
@@ -141,14 +139,16 @@ int ShelfModel::FirstRunningAppIndex() const {
ShelfItem weight_dummy;
weight_dummy.type = TYPE_WINDOWED_APP;
return std::lower_bound(items_.begin(), items_.end(), weight_dummy,
- CompareByWeight) - items_.begin();
+ CompareByWeight) -
+ items_.begin();
}
int ShelfModel::FirstPanelIndex() const {
ShelfItem weight_dummy;
weight_dummy.type = TYPE_APP_PANEL;
return std::lower_bound(items_.begin(), items_.end(), weight_dummy,
- CompareByWeight) - items_.begin();
+ CompareByWeight) -
+ items_.begin();
}
void ShelfModel::AddObserver(ShelfModelObserver* observer) {
@@ -166,10 +166,12 @@ int ShelfModel::ValidateInsertionIndex(ShelfItemType type, int index) const {
ShelfItem weight_dummy;
weight_dummy.type = type;
index = std::max(std::lower_bound(items_.begin(), items_.end(), weight_dummy,
- CompareByWeight) - items_.begin(),
+ CompareByWeight) -
+ items_.begin(),
static_cast<ShelfItems::difference_type>(index));
index = std::min(std::upper_bound(items_.begin(), items_.end(), weight_dummy,
- CompareByWeight) - items_.begin(),
+ CompareByWeight) -
+ items_.begin(),
static_cast<ShelfItems::difference_type>(index));
return index;
« no previous file with comments | « ash/common/shelf/shelf_item_types.cc ('k') | ash/common/shelf/shelf_model_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698