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

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: ShellWindowUpdate -> ShellWindowIconUpdated 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 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 if (launcher_id == 0) 244 if (launcher_id == 0)
245 launcher_id = owner_->CreateAppLauncherItem(controller, app_id, status); 245 launcher_id = owner_->CreateAppLauncherItem(controller, app_id, status);
246 else 246 else
247 owner_->SetItemController(launcher_id, controller); 247 owner_->SetItemController(launcher_id, controller);
248 const std::string app_launcher_id = GetAppLauncherId(shell_window); 248 const std::string app_launcher_id = GetAppLauncherId(shell_window);
249 app_controller_map_[app_launcher_id] = controller; 249 app_controller_map_[app_launcher_id] = controller;
250 } 250 }
251 owner_->SetItemStatus(launcher_id, status); 251 owner_->SetItemStatus(launcher_id, status);
252 } 252 }
253 253
254 void ShellWindowLauncherController::OnShellWindowIconUpdated(
255 ShellWindow* shell_window) {
256 // TODO(stevenjb): Fetch and set the launcher icon using
257 // shell_window->app_icon_url().
258 }
259
254 void ShellWindowLauncherController::OnShellWindowRemoved( 260 void ShellWindowLauncherController::OnShellWindowRemoved(
255 ShellWindow* shell_window) { 261 ShellWindow* shell_window) {
256 // Do nothing here; shell_window->window() has allready been deleted and 262 // Do nothing here; shell_window->window() has allready been deleted and
257 // OnWindowDestroying() has been called, doing the removal. 263 // OnWindowDestroying() has been called, doing the removal.
258 } 264 }
259 265
260 // Called from ~aura::Window(), before delegate_->OnWindowDestroyed() which 266 // Called from ~aura::Window(), before delegate_->OnWindowDestroyed() which
261 // destroys ShellWindow, so both |window| and the associated ShellWindow 267 // destroys ShellWindow, so both |window| and the associated ShellWindow
262 // are valid here. 268 // are valid here.
263 void ShellWindowLauncherController::OnWindowDestroying(aura::Window* window) { 269 void ShellWindowLauncherController::OnWindowDestroying(aura::Window* window) {
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 WindowToAppLauncherIdMap::iterator iter1 = 312 WindowToAppLauncherIdMap::iterator iter1 =
307 window_to_app_launcher_id_map_.find(window); 313 window_to_app_launcher_id_map_.find(window);
308 if (iter1 == window_to_app_launcher_id_map_.end()) 314 if (iter1 == window_to_app_launcher_id_map_.end())
309 return NULL; 315 return NULL;
310 std::string app_launcher_id = iter1->second; 316 std::string app_launcher_id = iter1->second;
311 AppControllerMap::iterator iter2 = app_controller_map_.find(app_launcher_id); 317 AppControllerMap::iterator iter2 = app_controller_map_.find(app_launcher_id);
312 if (iter2 == app_controller_map_.end()) 318 if (iter2 == app_controller_map_.end())
313 return NULL; 319 return NULL;
314 return iter2->second; 320 return iter2->second;
315 } 321 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698