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

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

Issue 10375021: Move Extension into extensions namespace (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Take 6 Created 8 years, 7 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 unified diff | Download patch
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/views/ash/launcher/browser_launcher_item_controller. h" 5 #include "chrome/browser/ui/views/ash/launcher/browser_launcher_item_controller. 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 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 } 181 }
182 // Update the icon for extension panels. 182 // Update the icon for extension panels.
183 SkBitmap new_image = favicon_loader_->GetFavicon(); 183 SkBitmap new_image = favicon_loader_->GetFavicon();
184 if (new_image.empty() && tab->extension_tab_helper()->GetExtensionAppIcon()) 184 if (new_image.empty() && tab->extension_tab_helper()->GetExtensionAppIcon())
185 new_image = *tab->extension_tab_helper()->GetExtensionAppIcon(); 185 new_image = *tab->extension_tab_helper()->GetExtensionAppIcon();
186 // Only update the icon if we have a new image, or none has been set yet. 186 // Only update the icon if we have a new image, or none has been set yet.
187 // This avoids flickering to an empty image when a pinned app is opened. 187 // This avoids flickering to an empty image when a pinned app is opened.
188 if (!new_image.empty()) 188 if (!new_image.empty())
189 item.image = new_image; 189 item.image = new_image;
190 else if (item.image.empty()) 190 else if (item.image.empty())
191 item.image = Extension::GetDefaultIcon(true); 191 item.image = extensions::Extension::GetDefaultIcon(true);
192 } else { 192 } else {
193 DCHECK_EQ(TYPE_TABBED, type_); 193 DCHECK_EQ(TYPE_TABBED, type_);
194 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); 194 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
195 if (tab->favicon_tab_helper()->ShouldDisplayFavicon()) { 195 if (tab->favicon_tab_helper()->ShouldDisplayFavicon()) {
196 item.image = tab->favicon_tab_helper()->GetFavicon(); 196 item.image = tab->favicon_tab_helper()->GetFavicon();
197 if (item.image.empty()) { 197 if (item.image.empty()) {
198 item.image = *rb.GetBitmapNamed(IDR_DEFAULT_FAVICON); 198 item.image = *rb.GetBitmapNamed(IDR_DEFAULT_FAVICON);
199 } 199 }
200 } else { 200 } else {
201 item.image = *rb.GetBitmapNamed(IDR_DEFAULT_FAVICON); 201 item.image = *rb.GetBitmapNamed(IDR_DEFAULT_FAVICON);
202 } 202 }
203 } 203 }
204 launcher_model()->Set(item_index, item); 204 launcher_model()->Set(item_index, item);
205 } 205 }
206 206
207 ash::LauncherModel* BrowserLauncherItemController::launcher_model() { 207 ash::LauncherModel* BrowserLauncherItemController::launcher_model() {
208 return launcher_controller_->model(); 208 return launcher_controller_->model();
209 } 209 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/ash/extension_utils.cc ('k') | chrome/browser/ui/views/ash/launcher/chrome_launcher_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698