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

Unified Diff: ash/shell/window_watcher.cc

Issue 23606016: Refactor LauncherItemController and LauncherItemDelegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix for LauncherTest and observing LauncherModel in DelegateManager Created 7 years, 3 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/shell/window_watcher.cc
diff --git a/ash/shell/window_watcher.cc b/ash/shell/window_watcher.cc
index 4dfcea4e57746993c3b900acb0fd50d8a039c4e8..ffe955c3fce571ba6bd05436ec39fffdbc995505 100644
--- a/ash/shell/window_watcher.cc
+++ b/ash/shell/window_watcher.cc
@@ -6,9 +6,11 @@
#include "ash/display/display_controller.h"
#include "ash/launcher/launcher.h"
+#include "ash/launcher/launcher_item_delegate_manager.h"
#include "ash/launcher/launcher_model.h"
#include "ash/shelf/shelf_widget.h"
#include "ash/shell.h"
+#include "ash/shell/launcher_item_delegate_impl.h"
#include "ash/shell_window_ids.h"
#include "ui/aura/root_window.h"
#include "ui/aura/window.h"
@@ -108,7 +110,8 @@ void WindowWatcher::OnWindowAdded(aura::Window* new_window) {
ash::LauncherItem item;
item.type = new_window->type() == aura::client::WINDOW_TYPE_PANEL ?
ash::TYPE_APP_PANEL : ash::TYPE_PLATFORM_APP;
- id_to_window_[model->next_id()] = new_window;
+ ash::LauncherID id = model->next_id();
+ id_to_window_[id] = new_window;
SkBitmap icon_bitmap;
icon_bitmap.setConfig(SkBitmap::kARGB_8888_Config, 16, 16);
@@ -122,6 +125,12 @@ void WindowWatcher::OnWindowAdded(aura::Window* new_window) {
ui::SCALE_FACTOR_100P));
model->Add(item);
+
+ ash::LauncherItemDelegateManager* manager =
+ ash::Shell::GetInstance()->launcher_item_delegate_manager();
+ manager->RegisterLauncherItemDelegate(
+ id,
+ new LauncherItemDelegateImpl(id, this));
}
void WindowWatcher::OnWillRemoveWindow(aura::Window* window) {

Powered by Google App Engine
This is Rietveld 408576698