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 570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
581 | 581 |
582 bool ThemeService::HasCustomImage(int id) const { | 582 bool ThemeService::HasCustomImage(int id) const { |
583 return BrowserThemePack::IsPersistentImageID(id) && theme_supplier_ && | 583 return BrowserThemePack::IsPersistentImageID(id) && theme_supplier_ && |
584 theme_supplier_->HasCustomImage(id); | 584 theme_supplier_->HasCustomImage(id); |
585 } | 585 } |
586 | 586 |
587 base::RefCountedMemory* ThemeService::GetRawData( | 587 base::RefCountedMemory* ThemeService::GetRawData( |
588 int id, | 588 int id, |
589 ui::ScaleFactor scale_factor) const { | 589 ui::ScaleFactor scale_factor) const { |
590 // Check to see whether we should substitute some images. | 590 // Check to see whether we should substitute some images. |
591 int ntp_alternate = GetDisplayProperty(ThemeProperties::NTP_LOGO_ALTERNATE); | 591 // TODO(fsamuel): Figure out why removing these resources on Android fixes |
592 if (id == IDR_PRODUCT_LOGO && ntp_alternate != 0) | 592 // loading. |
593 id = IDR_PRODUCT_LOGO_WHITE; | 593 // int ntp_alternate = |
| 594 // GetDisplayProperty(ThemeProperties::NTP_LOGO_ALTERNATE); |
| 595 // if (id == IDR_PRODUCT_LOGO && ntp_alternate != 0) |
| 596 // id = IDR_PRODUCT_LOGO_WHITE; |
594 | 597 |
595 base::RefCountedMemory* data = nullptr; | 598 base::RefCountedMemory* data = nullptr; |
596 if (theme_supplier_) | 599 if (theme_supplier_) |
597 data = theme_supplier_->GetRawData(id, scale_factor); | 600 data = theme_supplier_->GetRawData(id, scale_factor); |
598 if (!data) | 601 if (!data) |
599 data = rb_.LoadDataResourceBytesForScale(id, ui::SCALE_FACTOR_100P); | 602 data = rb_.LoadDataResourceBytesForScale(id, ui::SCALE_FACTOR_100P); |
600 | 603 |
601 return data; | 604 return data; |
602 } | 605 } |
603 | 606 |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
774 | 777 |
775 bool ThemeService::BrowserThemeProvider::HasCustomImage(int id) const { | 778 bool ThemeService::BrowserThemeProvider::HasCustomImage(int id) const { |
776 return theme_service_.HasCustomImage(id); | 779 return theme_service_.HasCustomImage(id); |
777 } | 780 } |
778 | 781 |
779 base::RefCountedMemory* ThemeService::BrowserThemeProvider::GetRawData( | 782 base::RefCountedMemory* ThemeService::BrowserThemeProvider::GetRawData( |
780 int id, | 783 int id, |
781 ui::ScaleFactor scale_factor) const { | 784 ui::ScaleFactor scale_factor) const { |
782 return theme_service_.GetRawData(id, scale_factor); | 785 return theme_service_.GetRawData(id, scale_factor); |
783 } | 786 } |
OLD | NEW |