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/views/aura/launcher/launcher_updater.h" | 5 #include "chrome/browser/ui/views/aura/launcher/launcher_updater.h" |
6 | 6 |
7 #include "ash/launcher/launcher.h" | 7 #include "ash/launcher/launcher.h" |
8 #include "ash/launcher/launcher_model.h" | 8 #include "ash/launcher/launcher_model.h" |
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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 TabContentsWrapper** tab) { | 139 TabContentsWrapper** tab) { |
140 *tab = NULL; | 140 *tab = NULL; |
141 for (Instances::const_iterator i = instances_->begin(); | 141 for (Instances::const_iterator i = instances_->begin(); |
142 i != instances_->end(); ++i) { | 142 i != instances_->end(); ++i) { |
143 if ((*i)->ContainsID(id, tab)) | 143 if ((*i)->ContainsID(id, tab)) |
144 return *i; | 144 return *i; |
145 } | 145 } |
146 return NULL; | 146 return NULL; |
147 } | 147 } |
148 | 148 |
149 void LauncherUpdater::SetAppImage(TabContentsWrapper* tab, SkBitmap* image) { | 149 void LauncherUpdater::SetAppImage(TabContentsWrapper* tab, |
| 150 const SkBitmap* image) { |
150 if (app_map_.find(tab) == app_map_.end()) | 151 if (app_map_.find(tab) == app_map_.end()) |
151 return; | 152 return; |
152 | 153 |
153 int model_index = launcher_model_->ItemIndexByID(app_map_[tab].id); | 154 int model_index = launcher_model_->ItemIndexByID(app_map_[tab].id); |
154 ash::LauncherItem item = launcher_model_->items()[model_index]; | 155 ash::LauncherItem item = launcher_model_->items()[model_index]; |
155 item.image = image ? *image : Extension::GetDefaultIcon(true); | 156 item.image = image ? *image : Extension::GetDefaultIcon(true); |
156 launcher_model_->Set(model_index, item); | 157 launcher_model_->Set(model_index, item); |
157 } | 158 } |
158 | 159 |
159 void LauncherUpdater::SetAppIconLoaderForTest(AppIconLoader* loader) { | 160 void LauncherUpdater::SetAppIconLoaderForTest(AppIconLoader* loader) { |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
389 return true; | 390 return true; |
390 for (AppTabMap::const_iterator i = app_map_.begin(); i != app_map_.end(); | 391 for (AppTabMap::const_iterator i = app_map_.begin(); i != app_map_.end(); |
391 ++i) { | 392 ++i) { |
392 if (i->second.id == id) { | 393 if (i->second.id == id) { |
393 *tab = i->first; | 394 *tab = i->first; |
394 return true; | 395 return true; |
395 } | 396 } |
396 } | 397 } |
397 return false; | 398 return false; |
398 } | 399 } |
OLD | NEW |