Chromium Code Reviews| 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 726 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 737 } | 737 } |
| 738 | 738 |
| 739 default: | 739 default: |
| 740 return -1; | 740 return -1; |
| 741 } | 741 } |
| 742 } | 742 } |
| 743 | 743 |
| 744 base::RefCountedMemory* ThemeService::GetRawData( | 744 base::RefCountedMemory* ThemeService::GetRawData( |
| 745 int id, | 745 int id, |
| 746 ui::ScaleFactor scale_factor) const { | 746 ui::ScaleFactor scale_factor) const { |
| 747 // Check to see whether we should substitute some images. | |
| 748 int ntp_alternate = GetDisplayProperty(ThemeProperties::NTP_LOGO_ALTERNATE); | |
| 749 if (id == IDR_PRODUCT_LOGO && ntp_alternate != 0) | |
|
Evan Stade
2017/03/08 17:56:30
are you sure this code is dead? It seems to be hit
Mathieu
2017/03/08 18:20:22
I am certain. I instrumented the codepaths in this
| |
| 750 id = IDR_PRODUCT_LOGO_WHITE; | |
| 751 | |
| 752 base::RefCountedMemory* data = nullptr; | 747 base::RefCountedMemory* data = nullptr; |
| 753 if (theme_supplier_) | 748 if (theme_supplier_) |
| 754 data = theme_supplier_->GetRawData(id, scale_factor); | 749 data = theme_supplier_->GetRawData(id, scale_factor); |
| 755 if (!data) | 750 if (!data) |
| 756 data = rb_.LoadDataResourceBytesForScale(id, ui::SCALE_FACTOR_100P); | 751 data = rb_.LoadDataResourceBytesForScale(id, ui::SCALE_FACTOR_100P); |
| 757 | 752 |
| 758 return data; | 753 return data; |
| 759 } | 754 } |
| 760 | 755 |
| 761 gfx::Image ThemeService::GetImageNamed(int id, bool incognito) const { | 756 gfx::Image ThemeService::GetImageNamed(int id, bool incognito) const { |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 869 | 864 |
| 870 #if BUILDFLAG(ENABLE_SUPERVISED_USERS) | 865 #if BUILDFLAG(ENABLE_SUPERVISED_USERS) |
| 871 bool ThemeService::IsSupervisedUser() const { | 866 bool ThemeService::IsSupervisedUser() const { |
| 872 return profile_->IsSupervised(); | 867 return profile_->IsSupervised(); |
| 873 } | 868 } |
| 874 | 869 |
| 875 void ThemeService::SetSupervisedUserTheme() { | 870 void ThemeService::SetSupervisedUserTheme() { |
| 876 SetCustomDefaultTheme(new SupervisedUserTheme); | 871 SetCustomDefaultTheme(new SupervisedUserTheme); |
| 877 } | 872 } |
| 878 #endif | 873 #endif |
| OLD | NEW |