OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_properties.h" | 5 #include "chrome/browser/themes/theme_properties.h" |
6 | 6 |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "base/strings/string_split.h" | 8 #include "base/strings/string_split.h" |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "chrome/browser/themes/browser_theme_pack.h" | 10 #include "chrome/browser/themes/browser_theme_pack.h" |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 if (tiling == REPEAT_Y) | 196 if (tiling == REPEAT_Y) |
197 return kTilingRepeatY; | 197 return kTilingRepeatY; |
198 if (tiling == REPEAT) | 198 if (tiling == REPEAT) |
199 return kTilingRepeat; | 199 return kTilingRepeat; |
200 return kTilingNoRepeat; | 200 return kTilingNoRepeat; |
201 } | 201 } |
202 | 202 |
203 // static | 203 // static |
204 bool ThemeProperties::IsThemeableImage(int id) { | 204 bool ThemeProperties::IsThemeableImage(int id) { |
205 // TODO(pkotwicz): Cache results to improve lookup speed. | 205 // TODO(pkotwicz): Cache results to improve lookup speed. |
206 std::set<int> themeable_idrs; | 206 return BrowserThemePack::IsThemeableImageIDRs(id); |
207 BrowserThemePack::GetThemeableImageIDRs(&themeable_idrs); | |
208 return themeable_idrs.find(id) != themeable_idrs.end(); | |
209 } | 207 } |
210 | 208 |
211 // static | 209 // static |
212 const std::set<int>& ThemeProperties::GetTintableToolbarButtons() { | 210 const std::set<int>& ThemeProperties::GetTintableToolbarButtons() { |
213 CR_DEFINE_STATIC_LOCAL(std::set<int>, button_set, ()); | 211 CR_DEFINE_STATIC_LOCAL(std::set<int>, button_set, ()); |
214 if (button_set.empty()) { | 212 if (button_set.empty()) { |
215 button_set = std::set<int>( | 213 button_set = std::set<int>( |
216 kToolbarButtonIDs, | 214 kToolbarButtonIDs, |
217 kToolbarButtonIDs + arraysize(kToolbarButtonIDs)); | 215 kToolbarButtonIDs + arraysize(kToolbarButtonIDs)); |
218 } | 216 } |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 case NTP_BACKGROUND_ALIGNMENT: | 309 case NTP_BACKGROUND_ALIGNMENT: |
312 return kDefaultDisplayPropertyNTPAlignment; | 310 return kDefaultDisplayPropertyNTPAlignment; |
313 case NTP_BACKGROUND_TILING: | 311 case NTP_BACKGROUND_TILING: |
314 return kDefaultDisplayPropertyNTPTiling; | 312 return kDefaultDisplayPropertyNTPTiling; |
315 case NTP_LOGO_ALTERNATE: | 313 case NTP_LOGO_ALTERNATE: |
316 return kDefaultDisplayPropertyNTPAlternateLogo; | 314 return kDefaultDisplayPropertyNTPAlternateLogo; |
317 } | 315 } |
318 | 316 |
319 return -1; | 317 return -1; |
320 } | 318 } |
OLD | NEW |