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

Unified Diff: chrome/browser/ui/views/tabs/browser_tab_strip_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/ui/views/location_bar/location_bar_view.cc ('k') | ui/gfx/image/image.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc
diff --git a/chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc b/chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc
index d101fc1e0e215af8dbc5420859d8d369ef7e32a6..32262035edabbf446656165a858bbb1263ade1f9 100644
--- a/chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc
+++ b/chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc
@@ -512,8 +512,8 @@ void BrowserTabStripController::SetTabRendererDataFromModel(
TabContents* tab_contents = TabContents::FromWebContents(contents);
// TODO: Convert data->favicon to gfx::Image.
- data->favicon =
- tab_contents->favicon_tab_helper()->GetFavicon().AsBitmap();
+ const gfx::Image& icon = tab_contents->favicon_tab_helper()->GetFavicon();
+ data->favicon = icon.IsEmpty() ? SkBitmap() : *icon.ToSkBitmap();
data->network_state = TabContentsNetworkState(contents);
data->title = contents->GetTitle();
data->url = contents->GetURL();
« no previous file with comments | « chrome/browser/ui/views/location_bar/location_bar_view.cc ('k') | ui/gfx/image/image.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698