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

Unified Diff: chrome/browser/android/compositor/layer/tab_layer.cc

Issue 1217893013: Don't preload rarely seen large images (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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/android/java/src/org/chromium/chrome/browser/compositor/resources/StaticResourcePreloads.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/compositor/layer/tab_layer.cc
diff --git a/chrome/browser/android/compositor/layer/tab_layer.cc b/chrome/browser/android/compositor/layer/tab_layer.cc
index 9efaea5d42ef6c81017dc07917f2659a88254e2f..638c26a26b26b5b81a97782a6e60dff34a93bc0c 100644
--- a/chrome/browser/android/compositor/layer/tab_layer.cc
+++ b/chrome/browser/android/compositor/layer/tab_layer.cc
@@ -124,9 +124,7 @@ void TabLayer::SetProperties(int id,
ui::ResourceManager::Resource* close_btn_resource =
resource_manager_->GetResource(ui::ANDROID_RESOURCE_TYPE_STATIC,
close_button_resource_id);
- ui::ResourceManager::Resource* back_logo_resource =
- resource_manager_->GetResource(ui::ANDROID_RESOURCE_TYPE_STATIC,
- back_logo_resource_id);
+ ui::ResourceManager::Resource* back_logo_resource = nullptr;
DecorationTitle* title_layer = nullptr;
@@ -217,8 +215,13 @@ void TabLayer::SetProperties(int id,
gfx::Size title_size(width - close_btn_effective_width, border_padding.y());
gfx::Size back_logo_size;
// TODO(clholgat): Figure out why the back logo is null sometimes.
- if (back_logo_resource)
- back_logo_size = back_logo_resource->size;
+ if (back_visible) {
+ back_logo_resource =
+ resource_manager_->GetResource(ui::ANDROID_RESOURCE_TYPE_STATIC,
Maria 2015/07/01 21:46:24 indent + 2
zbowling_chromium 2015/07/01 22:21:29 Done.
+ back_logo_resource_id);
+ if (back_logo_resource)
+ back_logo_size = back_logo_resource->size;
+ }
// Store this size at a point as it might go negative during the inset
// calculations.
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/compositor/resources/StaticResourcePreloads.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698