| Index: chrome/browser/themes/theme_service.cc
|
| diff --git a/chrome/browser/themes/theme_service.cc b/chrome/browser/themes/theme_service.cc
|
| index 11e8f1767a9b9aa2ed06f5019d260690fb9e900e..8f47278d09c158a334fdd99cacfe6d8db1b96336 100644
|
| --- a/chrome/browser/themes/theme_service.cc
|
| +++ b/chrome/browser/themes/theme_service.cc
|
| @@ -672,7 +672,7 @@ SkColor ThemeService::GetSeparatorColor(SkColor tab_color,
|
| }
|
|
|
| gfx::ImageSkia* ThemeService::GetImageSkiaNamed(int id, bool incognito) const {
|
| - gfx::Image image = GetImageNamed(id, incognito);
|
| + const gfx::Image& image = GetImageNamed(id, incognito);
|
| if (image.IsEmpty())
|
| return nullptr;
|
| // TODO(pkotwicz): Remove this const cast. The gfx::Image interface returns
|
| @@ -744,7 +744,7 @@ base::RefCountedMemory* ThemeService::GetRawData(
|
| return data;
|
| }
|
|
|
| -gfx::Image ThemeService::GetImageNamed(int id, bool incognito) const {
|
| +const gfx::Image& ThemeService::GetImageNamed(int id, bool incognito) const {
|
| DCHECK(CalledOnValidThread());
|
|
|
| int adjusted_id = id;
|
| @@ -755,14 +755,13 @@ gfx::Image ThemeService::GetImageNamed(int id, bool incognito) const {
|
| adjusted_id = IDR_THEME_FRAME_INCOGNITO_INACTIVE;
|
| }
|
|
|
| - gfx::Image image;
|
| - if (theme_supplier_)
|
| - image = theme_supplier_->GetImageNamed(adjusted_id);
|
| -
|
| - if (image.IsEmpty())
|
| - image = rb_.GetNativeImageNamed(adjusted_id);
|
| + if (theme_supplier_) {
|
| + const gfx::Image& image = theme_supplier_->GetImageNamed(adjusted_id);
|
| + if (!image.IsEmpty())
|
| + return image;
|
| + }
|
|
|
| - return image;
|
| + return rb_.GetNativeImageNamed(adjusted_id);
|
| }
|
|
|
| void ThemeService::OnExtensionServiceReady() {
|
|
|