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

Side by Side Diff: chrome/browser/ui/ash/launcher/shell_window_launcher_controller.cc

Issue 11316292: Add app.window.setIcon (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 if (launcher_id == 0) 242 if (launcher_id == 0)
243 launcher_id = owner_->CreateAppLauncherItem(controller, app_id, status); 243 launcher_id = owner_->CreateAppLauncherItem(controller, app_id, status);
244 else 244 else
245 owner_->SetItemController(launcher_id, controller); 245 owner_->SetItemController(launcher_id, controller);
246 const std::string app_launcher_id = GetAppLauncherId(shell_window); 246 const std::string app_launcher_id = GetAppLauncherId(shell_window);
247 app_controller_map_[app_launcher_id] = controller; 247 app_controller_map_[app_launcher_id] = controller;
248 } 248 }
249 owner_->SetItemStatus(launcher_id, status); 249 owner_->SetItemStatus(launcher_id, status);
250 } 250 }
251 251
252 void ShellWindowLauncherController::OnShellWindowUpdated(
253 ShellWindow* shell_window) {
254 // TODO(stevenjb): Fetch and set the launcher icon using
255 // shell_window->launcher_icon_url().
256 }
257
252 void ShellWindowLauncherController::OnShellWindowRemoved( 258 void ShellWindowLauncherController::OnShellWindowRemoved(
253 ShellWindow* shell_window) { 259 ShellWindow* shell_window) {
254 // Do nothing here; shell_window->window() has allready been deleted and 260 // Do nothing here; shell_window->window() has allready been deleted and
255 // OnWindowDestroying() has been called, doing the removal. 261 // OnWindowDestroying() has been called, doing the removal.
256 } 262 }
257 263
258 // Called from ~aura::Window(), before delegate_->OnWindowDestroyed() which 264 // Called from ~aura::Window(), before delegate_->OnWindowDestroyed() which
259 // destroys ShellWindow, so both |window| and the associated ShellWindow 265 // destroys ShellWindow, so both |window| and the associated ShellWindow
260 // are valid here. 266 // are valid here.
261 void ShellWindowLauncherController::OnWindowDestroying(aura::Window* window) { 267 void ShellWindowLauncherController::OnWindowDestroying(aura::Window* window) {
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 WindowToAppLauncherIdMap::iterator iter1 = 310 WindowToAppLauncherIdMap::iterator iter1 =
305 window_to_app_launcher_id_map_.find(window); 311 window_to_app_launcher_id_map_.find(window);
306 if (iter1 == window_to_app_launcher_id_map_.end()) 312 if (iter1 == window_to_app_launcher_id_map_.end())
307 return NULL; 313 return NULL;
308 std::string app_launcher_id = iter1->second; 314 std::string app_launcher_id = iter1->second;
309 AppControllerMap::iterator iter2 = app_controller_map_.find(app_launcher_id); 315 AppControllerMap::iterator iter2 = app_controller_map_.find(app_launcher_id);
310 if (iter2 == app_controller_map_.end()) 316 if (iter2 == app_controller_map_.end())
311 return NULL; 317 return NULL;
312 return iter2->second; 318 return iter2->second;
313 } 319 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698