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

Unified Diff: ash/shelf/shelf_window_watcher.cc

Issue 2171813004: mash: Fold ShelfItemDelegateManager into ShelfModel (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cleanup Created 4 years, 5 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
Index: ash/shelf/shelf_window_watcher.cc
diff --git a/ash/shelf/shelf_window_watcher.cc b/ash/shelf/shelf_window_watcher.cc
index 25661b3d4f1f65351393ba0d8267f18ea19f7fa7..6ca0240b2685a16c6b4e0ac0767717cbb30da19a 100644
--- a/ash/shelf/shelf_window_watcher.cc
+++ b/ash/shelf/shelf_window_watcher.cc
@@ -9,7 +9,6 @@
#include "ash/aura/wm_window_aura.h"
#include "ash/common/shelf/shelf_constants.h"
-#include "ash/common/shelf/shelf_item_delegate_manager.h"
#include "ash/common/shelf/shelf_model.h"
#include "ash/common/shell_window_ids.h"
#include "ash/common/wm/window_state.h"
@@ -100,11 +99,8 @@ void ShelfWindowWatcher::RemovedWindowObserver::OnWindowDestroyed(
window_watcher_->FinishObservingRemovedWindow(window);
}
-ShelfWindowWatcher::ShelfWindowWatcher(
- ShelfModel* model,
- ShelfItemDelegateManager* item_delegate_manager)
+ShelfWindowWatcher::ShelfWindowWatcher(ShelfModel* model)
: model_(model),
- item_delegate_manager_(item_delegate_manager),
root_window_observer_(this),
removed_window_observer_(this),
observed_windows_(this),
@@ -132,8 +128,7 @@ void ShelfWindowWatcher::AddShelfItem(aura::Window* window) {
SetShelfIDForWindow(id, window);
std::unique_ptr<ShelfItemDelegate> item_delegate(
new ShelfWindowWatcherItemDelegate(window));
- // |item_delegate| is owned by |item_delegate_manager_|.
- item_delegate_manager_->SetShelfItemDelegate(id, std::move(item_delegate));
+ model_->SetShelfItemDelegate(id, std::move(item_delegate));
model_->Add(item);
}

Powered by Google App Engine
This is Rietveld 408576698