OLD | NEW |
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/themes/theme_service.h" | 5 #include "chrome/browser/themes/theme_service.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
(...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
585 | 585 |
586 bool ThemeService::HasCustomImage(int id) const { | 586 bool ThemeService::HasCustomImage(int id) const { |
587 return BrowserThemePack::IsPersistentImageID(id) && theme_supplier_ && | 587 return BrowserThemePack::IsPersistentImageID(id) && theme_supplier_ && |
588 theme_supplier_->HasCustomImage(id); | 588 theme_supplier_->HasCustomImage(id); |
589 } | 589 } |
590 | 590 |
591 base::RefCountedMemory* ThemeService::GetRawData( | 591 base::RefCountedMemory* ThemeService::GetRawData( |
592 int id, | 592 int id, |
593 ui::ScaleFactor scale_factor) const { | 593 ui::ScaleFactor scale_factor) const { |
594 // Check to see whether we should substitute some images. | 594 // Check to see whether we should substitute some images. |
595 int ntp_alternate = GetDisplayProperty(ThemeProperties::NTP_LOGO_ALTERNATE); | 595 // TODO(fsamuel): Figure out why removing these resources on Android fixes |
596 if (id == IDR_PRODUCT_LOGO && ntp_alternate != 0) | 596 // loading. |
597 id = IDR_PRODUCT_LOGO_WHITE; | 597 // int ntp_alternate = |
| 598 // GetDisplayProperty(ThemeProperties::NTP_LOGO_ALTERNATE); |
| 599 // if (id == IDR_PRODUCT_LOGO && ntp_alternate != 0) |
| 600 // id = IDR_PRODUCT_LOGO_WHITE; |
598 | 601 |
599 base::RefCountedMemory* data = nullptr; | 602 base::RefCountedMemory* data = nullptr; |
600 if (theme_supplier_) | 603 if (theme_supplier_) |
601 data = theme_supplier_->GetRawData(id, scale_factor); | 604 data = theme_supplier_->GetRawData(id, scale_factor); |
602 if (!data) | 605 if (!data) |
603 data = rb_.LoadDataResourceBytesForScale(id, ui::SCALE_FACTOR_100P); | 606 data = rb_.LoadDataResourceBytesForScale(id, ui::SCALE_FACTOR_100P); |
604 | 607 |
605 return data; | 608 return data; |
606 } | 609 } |
607 | 610 |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
778 | 781 |
779 bool ThemeService::BrowserThemeProvider::HasCustomImage(int id) const { | 782 bool ThemeService::BrowserThemeProvider::HasCustomImage(int id) const { |
780 return theme_service_.HasCustomImage(id); | 783 return theme_service_.HasCustomImage(id); |
781 } | 784 } |
782 | 785 |
783 base::RefCountedMemory* ThemeService::BrowserThemeProvider::GetRawData( | 786 base::RefCountedMemory* ThemeService::BrowserThemeProvider::GetRawData( |
784 int id, | 787 int id, |
785 ui::ScaleFactor scale_factor) const { | 788 ui::ScaleFactor scale_factor) const { |
786 return theme_service_.GetRawData(id, scale_factor); | 789 return theme_service_.GetRawData(id, scale_factor); |
787 } | 790 } |
OLD | NEW |