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

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 unittest.. Created 7 years, 2 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/shell/launcher_delegate_impl.cc ('k') | ash/shell/window_watcher_launcher_item_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/shell/window_watcher.cc
diff --git a/ash/shell/window_watcher.cc b/ash/shell/window_watcher.cc
index f076483a1e62fbdab863882894aaa458101538bb..7c72e27effaf394a09e624aed3f9fe7850122cc0 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/window_watcher_launcher_item_delegate.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);
@@ -121,6 +124,12 @@ void WindowWatcher::OnWindowAdded(aura::Window* new_window) {
item.image = gfx::ImageSkia(gfx::ImageSkiaRep(icon_bitmap, 1.0f));
model->Add(item);
+
+ ash::LauncherItemDelegateManager* manager =
+ ash::Shell::GetInstance()->launcher_item_delegate_manager();
+ scoped_ptr<LauncherItemDelegate> delegate(
+ new WindowWatcherLauncherItemDelegate(id, this));
+ manager->SetLauncherItemDelegate(id, delegate.Pass());
}
void WindowWatcher::OnWillRemoveWindow(aura::Window* window) {
« no previous file with comments | « ash/shell/launcher_delegate_impl.cc ('k') | ash/shell/window_watcher_launcher_item_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698