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

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

Issue 2608013002: mash: Replace ShelfItemDelegate::CanPin with ShelfItem::pinned_by_policy. (Closed)
Patch Set: Fix test. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/common/shelf/shelf_item_types.h ('k') | ash/common/shelf/shelf_window_watcher_item_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/shelf/shelf_view.cc
diff --git a/ash/common/shelf/shelf_view.cc b/ash/common/shelf/shelf_view.cc
index f85e154d9afd5d624384a0ff9b3e426de97b7681..5a6bfaa6263e7e25ce84b25744ba31734f18d7d1 100644
--- a/ash/common/shelf/shelf_view.cc
+++ b/ash/common/shelf/shelf_view.cc
@@ -1351,12 +1351,11 @@ ShelfView::RemovableState ShelfView::RemovableByRipOff(int index) const {
if (type == TYPE_APP_LIST || type == TYPE_DIALOG)
return NOT_REMOVABLE;
- std::string app_id = delegate_->GetAppIDForShelfID(model_->items()[index].id);
- ShelfItemDelegate* item_delegate =
- model_->GetShelfItemDelegate(model_->items()[index].id);
- if (!item_delegate->CanPin())
+ if (model_->items()[index].pinned_by_policy)
return NOT_REMOVABLE;
+
// Note: Only pinned app shortcuts can be removed!
+ std::string app_id = delegate_->GetAppIDForShelfID(model_->items()[index].id);
return (type == TYPE_APP_SHORTCUT && delegate_->IsAppPinned(app_id))
? REMOVABLE
: DRAGGABLE;
« no previous file with comments | « ash/common/shelf/shelf_item_types.h ('k') | ash/common/shelf/shelf_window_watcher_item_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698