| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/supervised_user/supervised_user_theme.h" | 5 #include "chrome/browser/supervised_user/supervised_user_theme.h" |
| 6 | 6 |
| 7 #include "chrome/browser/themes/theme_properties.h" | 7 #include "chrome/browser/themes/theme_properties.h" |
| 8 #include "grit/theme_resources.h" | 8 #include "grit/theme_resources.h" |
| 9 #include "ui/base/resource/resource_bundle.h" | 9 #include "ui/base/resource/resource_bundle.h" |
| 10 #include "ui/gfx/image/image.h" | 10 #include "ui/gfx/image/image.h" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 case ThemeProperties::COLOR_SUPERVISED_USER_LABEL: | 49 case ThemeProperties::COLOR_SUPERVISED_USER_LABEL: |
| 50 *color = SK_ColorWHITE; | 50 *color = SK_ColorWHITE; |
| 51 return true; | 51 return true; |
| 52 case ThemeProperties::COLOR_SUPERVISED_USER_LABEL_BACKGROUND: | 52 case ThemeProperties::COLOR_SUPERVISED_USER_LABEL_BACKGROUND: |
| 53 *color = kDefaultColorSupervisedUserLabelBackground; | 53 *color = kDefaultColorSupervisedUserLabelBackground; |
| 54 return true; | 54 return true; |
| 55 } | 55 } |
| 56 return false; | 56 return false; |
| 57 } | 57 } |
| 58 | 58 |
| 59 gfx::Image SupervisedUserTheme::GetImageNamed(int id) { | 59 const gfx::Image& SupervisedUserTheme::GetImageNamed(int id) { |
| 60 if (!HasCustomImage(id)) | 60 if (!HasCustomImage(id)) |
| 61 return gfx::Image(); | 61 return empty_image(); |
| 62 | 62 |
| 63 id = MapToSupervisedUserResourceIds(id); | 63 id = MapToSupervisedUserResourceIds(id); |
| 64 return ResourceBundle::GetSharedInstance().GetNativeImageNamed(id); | 64 return ResourceBundle::GetSharedInstance().GetNativeImageNamed(id); |
| 65 } | 65 } |
| 66 | 66 |
| 67 bool SupervisedUserTheme::HasCustomImage(int id) const { | 67 bool SupervisedUserTheme::HasCustomImage(int id) const { |
| 68 return id != MapToSupervisedUserResourceIds(id); | 68 return id != MapToSupervisedUserResourceIds(id); |
| 69 } | 69 } |
| OLD | NEW |