| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/ui/ash/launcher/shell_window_launcher_controller.h" | 5 #include "chrome/browser/ui/ash/launcher/shell_window_launcher_controller.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
| 10 #include "ash/wm/window_util.h" | 10 #include "ash/wm/window_util.h" |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 if (launcher_id == 0) | 246 if (launcher_id == 0) |
| 247 launcher_id = owner_->CreateAppLauncherItem(controller, app_id, status); | 247 launcher_id = owner_->CreateAppLauncherItem(controller, app_id, status); |
| 248 else | 248 else |
| 249 owner_->SetItemController(launcher_id, controller); | 249 owner_->SetItemController(launcher_id, controller); |
| 250 const std::string app_launcher_id = GetAppLauncherId(shell_window); | 250 const std::string app_launcher_id = GetAppLauncherId(shell_window); |
| 251 app_controller_map_[app_launcher_id] = controller; | 251 app_controller_map_[app_launcher_id] = controller; |
| 252 } | 252 } |
| 253 owner_->SetItemStatus(launcher_id, status); | 253 owner_->SetItemStatus(launcher_id, status); |
| 254 } | 254 } |
| 255 | 255 |
| 256 void ShellWindowLauncherController::OnShellWindowIconChanged( |
| 257 ShellWindow* shell_window) { |
| 258 // TODO(stevenjb): Fetch and set the launcher icon using |
| 259 // shell_window->app_icon_url(). |
| 260 } |
| 261 |
| 256 void ShellWindowLauncherController::OnShellWindowRemoved( | 262 void ShellWindowLauncherController::OnShellWindowRemoved( |
| 257 ShellWindow* shell_window) { | 263 ShellWindow* shell_window) { |
| 258 // Do nothing here; shell_window->window() has allready been deleted and | 264 // Do nothing here; shell_window->window() has allready been deleted and |
| 259 // OnWindowDestroying() has been called, doing the removal. | 265 // OnWindowDestroying() has been called, doing the removal. |
| 260 } | 266 } |
| 261 | 267 |
| 262 // Called from ~aura::Window(), before delegate_->OnWindowDestroyed() which | 268 // Called from ~aura::Window(), before delegate_->OnWindowDestroyed() which |
| 263 // destroys ShellWindow, so both |window| and the associated ShellWindow | 269 // destroys ShellWindow, so both |window| and the associated ShellWindow |
| 264 // are valid here. | 270 // are valid here. |
| 265 void ShellWindowLauncherController::OnWindowDestroying(aura::Window* window) { | 271 void ShellWindowLauncherController::OnWindowDestroying(aura::Window* window) { |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 WindowToAppLauncherIdMap::iterator iter1 = | 314 WindowToAppLauncherIdMap::iterator iter1 = |
| 309 window_to_app_launcher_id_map_.find(window); | 315 window_to_app_launcher_id_map_.find(window); |
| 310 if (iter1 == window_to_app_launcher_id_map_.end()) | 316 if (iter1 == window_to_app_launcher_id_map_.end()) |
| 311 return NULL; | 317 return NULL; |
| 312 std::string app_launcher_id = iter1->second; | 318 std::string app_launcher_id = iter1->second; |
| 313 AppControllerMap::iterator iter2 = app_controller_map_.find(app_launcher_id); | 319 AppControllerMap::iterator iter2 = app_controller_map_.find(app_launcher_id); |
| 314 if (iter2 == app_controller_map_.end()) | 320 if (iter2 == app_controller_map_.end()) |
| 315 return NULL; | 321 return NULL; |
| 316 return iter2->second; | 322 return iter2->second; |
| 317 } | 323 } |
| OLD | NEW |