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

Unified Diff: chrome/browser/ui/ash/launcher/browser_launcher_item_controller.cc

Issue 10837215: exhibit 1: explicit null checks Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 4 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
« no previous file with comments | « chrome/browser/task_manager/task_manager_resource_providers.cc ('k') | chrome/browser/ui/browser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/ash/launcher/browser_launcher_item_controller.cc
diff --git a/chrome/browser/ui/ash/launcher/browser_launcher_item_controller.cc b/chrome/browser/ui/ash/launcher/browser_launcher_item_controller.cc
index b473e2b2d344d4698995c0e9f616103d335a7299..0bcf5a4b6fa6e883b7285712e4bd6ea9100e433d 100644
--- a/chrome/browser/ui/ash/launcher/browser_launcher_item_controller.cc
+++ b/chrome/browser/ui/ash/launcher/browser_launcher_item_controller.cc
@@ -227,10 +227,9 @@ void BrowserLauncherItemController::UpdateLauncher(TabContents* tab) {
DCHECK_EQ(TYPE_TABBED, type_);
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
if (tab->favicon_tab_helper()->ShouldDisplayFavicon()) {
- item.image = tab->favicon_tab_helper()->GetFavicon().AsBitmap();
- if (item.image.empty()) {
- item.image = *rb.GetBitmapNamed(IDR_DEFAULT_FAVICON);
- }
+ const gfx::Image& icon = tab->favicon_tab_helper()->GetFavicon();
+ item.image = icon.IsEmpty() ? *rb.GetBitmapNamed(IDR_DEFAULT_FAVICON) :
+ *icon.ToSkBitmap();
} else {
item.image = *rb.GetBitmapNamed(IDR_DEFAULT_FAVICON);
}
« no previous file with comments | « chrome/browser/task_manager/task_manager_resource_providers.cc ('k') | chrome/browser/ui/browser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698