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

Unified Diff: ash/shelf/shelf_controller.cc

Issue 2918223002: mash: Make ShelfWindowWatcher items for unknown windows. (Closed)
Patch Set: Disable failing mash browser test for now. Created 3 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 | « no previous file | ash/shelf/shelf_window_watcher.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/shelf/shelf_controller.cc
diff --git a/ash/shelf/shelf_controller.cc b/ash/shelf/shelf_controller.cc
index 16dcbb5084fbc48736a6b56a4747f9aaa37ec608..4132abe8303a7efbc29ea9375fcb1eaf285c877a 100644
--- a/ash/shelf/shelf_controller.cc
+++ b/ash/shelf/shelf_controller.cc
@@ -128,22 +128,22 @@ void ShelfController::SetAutoHideBehavior(ShelfAutoHideBehavior auto_hide,
}
void ShelfController::AddShelfItem(int32_t index, const ShelfItem& item) {
- DCHECK_EQ(Shell::GetAshConfig(), Config::MASH) << "Unexpected model sync";
- DCHECK(!applying_remote_shelf_model_changes_) << "Unexpected model change";
+ DCHECK_EQ(Shell::GetAshConfig(), Config::MASH) << " Unexpected model sync";
+ DCHECK(!applying_remote_shelf_model_changes_) << " Unexpected model change";
index = index < 0 ? model_.item_count() : index;
- DCHECK_GT(index, 0) << "Items can not preceed the AppList";
- DCHECK_LE(index, model_.item_count()) << "Index out of bounds";
+ DCHECK_GT(index, 0) << " Items can not preceed the AppList";
+ DCHECK_LE(index, model_.item_count()) << " Index out of bounds";
index = std::min(std::max(index, 1), model_.item_count());
base::AutoReset<bool> reset(&applying_remote_shelf_model_changes_, true);
model_.AddAt(index, item);
}
void ShelfController::RemoveShelfItem(const ShelfID& id) {
- DCHECK_EQ(Shell::GetAshConfig(), Config::MASH) << "Unexpected model sync";
- DCHECK(!applying_remote_shelf_model_changes_) << "Unexpected model change";
+ DCHECK_EQ(Shell::GetAshConfig(), Config::MASH) << " Unexpected model sync";
+ DCHECK(!applying_remote_shelf_model_changes_) << " Unexpected model change";
const int index = model_.ItemIndexByID(id);
- DCHECK_GE(index, 0) << "Item not found";
- DCHECK_NE(index, 0) << "The AppList shelf item cannot be removed";
+ DCHECK_GE(index, 0) << " No item found with the id: " << id;
+ DCHECK_NE(index, 0) << " The AppList shelf item cannot be removed";
if (index <= 0)
return;
base::AutoReset<bool> reset(&applying_remote_shelf_model_changes_, true);
@@ -151,17 +151,17 @@ void ShelfController::RemoveShelfItem(const ShelfID& id) {
}
void ShelfController::MoveShelfItem(const ShelfID& id, int32_t index) {
- DCHECK_EQ(Shell::GetAshConfig(), Config::MASH) << "Unexpected model sync";
- DCHECK(!applying_remote_shelf_model_changes_) << "Unexpected model change";
+ DCHECK_EQ(Shell::GetAshConfig(), Config::MASH) << " Unexpected model sync";
+ DCHECK(!applying_remote_shelf_model_changes_) << " Unexpected model change";
const int current_index = model_.ItemIndexByID(id);
- DCHECK_GE(current_index, 0) << "No item found with the given id";
- DCHECK_NE(current_index, 0) << "The AppList shelf item cannot be moved";
+ DCHECK_GE(current_index, 0) << " No item found with the id: " << id;
+ DCHECK_NE(current_index, 0) << " The AppList shelf item cannot be moved";
if (current_index <= 0)
return;
- DCHECK_GT(index, 0) << "Items can not preceed the AppList";
- DCHECK_LT(index, model_.item_count()) << "Index out of bounds";
+ DCHECK_GT(index, 0) << " Items can not preceed the AppList";
+ DCHECK_LT(index, model_.item_count()) << " Index out of bounds";
index = std::min(std::max(index, 1), model_.item_count() - 1);
- DCHECK_NE(current_index, index) << "The item is already at the given index";
+ DCHECK_NE(current_index, index) << " The item is already at the given index";
if (current_index == index)
return;
base::AutoReset<bool> reset(&applying_remote_shelf_model_changes_, true);
@@ -169,10 +169,10 @@ void ShelfController::MoveShelfItem(const ShelfID& id, int32_t index) {
}
void ShelfController::UpdateShelfItem(const ShelfItem& item) {
- DCHECK_EQ(Shell::GetAshConfig(), Config::MASH) << "Unexpected model sync";
- DCHECK(!applying_remote_shelf_model_changes_) << "Unexpected model change";
+ DCHECK_EQ(Shell::GetAshConfig(), Config::MASH) << " Unexpected model sync";
+ DCHECK(!applying_remote_shelf_model_changes_) << " Unexpected model change";
const int index = model_.ItemIndexByID(item.id);
- DCHECK_GE(index, 0) << "No item found with the given id";
+ DCHECK_GE(index, 0) << " No item found with the id: " << item.id;
if (index < 0)
return;
base::AutoReset<bool> reset(&applying_remote_shelf_model_changes_, true);
@@ -182,8 +182,8 @@ void ShelfController::UpdateShelfItem(const ShelfItem& item) {
void ShelfController::SetShelfItemDelegate(
const ShelfID& id,
mojom::ShelfItemDelegatePtr delegate) {
- DCHECK_EQ(Shell::GetAshConfig(), Config::MASH) << "Unexpected model sync";
- DCHECK(!applying_remote_shelf_model_changes_) << "Unexpected model change";
+ DCHECK_EQ(Shell::GetAshConfig(), Config::MASH) << " Unexpected model sync";
+ DCHECK(!applying_remote_shelf_model_changes_) << " Unexpected model change";
base::AutoReset<bool> reset(&applying_remote_shelf_model_changes_, true);
if (delegate.is_bound())
model_.SetShelfItemDelegate(
« no previous file with comments | « no previous file | ash/shelf/shelf_window_watcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698