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

Unified Diff: chrome/browser/ui/views/ash/launcher/chrome_launcher_delegate.cc

Issue 9689047: Added notion of currently active app / browser (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove default args from State Created 8 years, 9 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: chrome/browser/ui/views/ash/launcher/chrome_launcher_delegate.cc
diff --git a/chrome/browser/ui/views/ash/launcher/chrome_launcher_delegate.cc b/chrome/browser/ui/views/ash/launcher/chrome_launcher_delegate.cc
index 134a37e6fa95b551abbd876d7adfe381542ee455..83beaf094c3e576ef2c48f05f36c3d2867a1975f 100644
--- a/chrome/browser/ui/views/ash/launcher/chrome_launcher_delegate.cc
+++ b/chrome/browser/ui/views/ash/launcher/chrome_launcher_delegate.cc
@@ -202,9 +202,11 @@ ash::LauncherID ChromeLauncherDelegate::CreateAppLauncherItem(
void ChromeLauncherDelegate::SetItemStatus(ash::LauncherID id,
ash::LauncherItemStatus status) {
int index = model_->ItemIndexByID(id);
- ash::LauncherItem item = model_->items()[index];
- item.status = status;
- model_->Set(index, item);
+ if (index >= 0) {
sky 2012/03/13 17:14:42 Why is this conditional needed?
+ ash::LauncherItem item = model_->items()[index];
+ item.status = status;
+ model_->Set(index, item);
+ }
}
void ChromeLauncherDelegate::ConvertAppToTabbed(ash::LauncherID id) {
@@ -237,7 +239,6 @@ void ChromeLauncherDelegate::LauncherItemClosed(ash::LauncherID id) {
if (id_to_item_map_[id].pinned) {
// The item is pinned, leave it in the launcher.
id_to_item_map_[id].updater = NULL;
- printf("ChromeLauncherDelegate::LauncherItemClosed\n");
SetItemStatus(id, ash::STATUS_CLOSED);
} else {
id_to_item_map_.erase(id);

Powered by Google App Engine
This is Rietveld 408576698